aboutsummaryrefslogtreecommitdiff
path: root/bin/cat
diff options
context:
space:
mode:
authorSevan Janiyan <sevan@FreeBSD.org>2017-09-21 14:14:49 +0000
committerSevan Janiyan <sevan@FreeBSD.org>2017-09-21 14:14:49 +0000
commit6d2e5f3ddfa6777cd4925c57cd043950d047116a (patch)
tree9af7872736640f899c976e1bd60efba39685e2d7 /bin/cat
parented9de14d2f9b2067c348c376823c5784593d5c5f (diff)
downloadsrc-6d2e5f3ddfa6777cd4925c57cd043950d047116a.tar.gz
src-6d2e5f3ddfa6777cd4925c57cd043950d047116a.zip
Notes
Diffstat (limited to 'bin/cat')
-rw-r--r--bin/cat/cat.c14
-rw-r--r--bin/cat/tests/Makefile6
2 files changed, 10 insertions, 10 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 770ab61a08a4..57d48028906e 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -226,10 +226,16 @@ cook_cat(FILE *fp)
} else
gobble = 0;
}
- if (nflag && (!bflag || ch != '\n')) {
- (void)fprintf(stdout, "%6d\t", ++line);
- if (ferror(stdout))
- break;
+ if (nflag) {
+ if (!bflag || ch != '\n') {
+ (void)fprintf(stdout, "%6d\t", ++line);
+ if (ferror(stdout))
+ break;
+ } else if (eflag) {
+ (void)fprintf(stdout, "%6s\t", "");
+ if (ferror(stdout))
+ break;
+ }
}
}
if (ch == '\n') {
diff --git a/bin/cat/tests/Makefile b/bin/cat/tests/Makefile
index 92e16aea1732..ebc313c5a091 100644
--- a/bin/cat/tests/Makefile
+++ b/bin/cat/tests/Makefile
@@ -17,10 +17,4 @@ ${PACKAGE}FILES+= d_vt_output.out
.include <netbsd-tests.test.mk>
-d_align.out: ${TESTSRC}/d_align.out
- sed -E -e 's,^[[:space:]]{7}\$$$$,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp
- mv ${.TARGET}.tmp ${.TARGET}
-
-CLEANFILES+= d_align.out d_align.out.tmp
-
.include <bsd.test.mk>