Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2018 07:50:11 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330638 - in stable/11/bin/cat: . tests
Message-ID:  <201803080750.w287oB6s070319@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Mar  8 07:50:11 2018
New Revision: 330638
URL: https://svnweb.freebsd.org/changeset/base/330638

Log:
  MFC r323865:
  
  Ammend bin/cat/cat.c so the output is the same aside
  from blank lines being numbered or unnumbered, depending on whether cat
  was invoked with -ne or -be.
  
  At present, when cat is invoked with -be, there is an aditional
  difference that the '$' on blank lines is placed on the far left of the
  output.
  
  Discussed in bug 210607.
  
  While here, revert the workaround from r304035 which skipped the unit test for
  this issue previously.
  
  PR:		210607

Modified:
  stable/11/bin/cat/cat.c
  stable/11/bin/cat/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/cat/cat.c
==============================================================================
--- stable/11/bin/cat/cat.c	Thu Mar  8 07:17:20 2018	(r330637)
+++ stable/11/bin/cat/cat.c	Thu Mar  8 07:50:11 2018	(r330638)
@@ -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') {

Modified: stable/11/bin/cat/tests/Makefile
==============================================================================
--- stable/11/bin/cat/tests/Makefile	Thu Mar  8 07:17:20 2018	(r330637)
+++ stable/11/bin/cat/tests/Makefile	Thu Mar  8 07:50:11 2018	(r330638)
@@ -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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803080750.w287oB6s070319>