Bug 210607 - patch to bin/cat/cat.c to align output between when invoked with -be & -ne flags
Summary: patch to bin/cat/cat.c to align output between when invoked with -be & -ne flags
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Sevan Janiyan
URL: https://reviews.freebsd.org/D12432
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-06-27 01:48 UTC by Sevan Janiyan
Modified: 2018-03-10 08:51 UTC (History)
4 users (show)

See Also:


Attachments
patch cat.c & ATF tests (1.19 KB, patch)
2016-06-27 01:48 UTC, Sevan Janiyan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sevan Janiyan 2016-06-27 01:48:52 UTC
Created attachment 171845 [details]
patch cat.c & ATF tests

The attached patch amends 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.

The patch originates from r1.17 of bin/cat/cat.c from NetBSD.

Additionally, the ATF test is amended to test for the behaviour correctly (the test previously only checked if text was aligned, without blank lines where the issue being  tested for was present). This change is present upstream but provided here in case a vendor import is not feasible at this time.
Comment 1 John Baldwin freebsd_committer freebsd_triage 2016-08-04 16:59:37 UTC
I actually find the current behavior the correct one.  Note that GNU cat follows the current behavior:

> gcat -ne 
a b c
     1  a b c$

     2  $
def
     3  def$
^D                                                                              

vs:

> gcat -be
a b c 
     1  a b c$

$
def
     2  def$
^D                                                                              

The idea being that you only get leading indentation if there is a line number.
Comment 2 Sevan Janiyan 2016-08-05 14:15:03 UTC
(In reply to John Baldwin from comment #1)

> Note that GNU cat follows the current behavior:

These extensions to cat were introduced in BSD so the GNU implementation is an imitation of ours
https://svnweb.freebsd.org/csrg/bin/cat/cat.c?r1=962&r2=1357

> The idea being that you only get leading indentation if there is a line number.

Going to the description in the man pages, there is no reference to such behaviour which is really frustrating as it leaves it down to interpretation.  

FreeBSD
-b "Number the	non-blank output lines,	starting at 1."
-e "Display non-printing characters (see the -v option), and display a dollar sign (`$') at the end of each line."
-n "Number the	output lines, starting at 1."

2.9.1BSD
-b "This, together with -n cause numbers to be omitted from blank lines."
-e "Follow ends of lines with the $ character."
-n "Number each line."

I'd say for consistency the output should the same aside from what gets omitted with a specific flag when it is specified.
Comment 3 John Baldwin freebsd_committer freebsd_triage 2016-08-05 15:28:54 UTC
(In reply to Sevan Janiyan from comment #2)
1) The 'BSD' output from CSRG is the current one, not NetBSD's recent change.  The other output has been in place for 35 years.  There has to be a compelling reason to change it vs the tradeoff of breaking existing scripts and reducing compatibility with other systems.  'cat' on OS X follows the current output as well (inherited from BSD of course).

2) The language is not clear (and I'd be fine with clarifying it), but what you are changing is to have 'cat -be' insert extra leading blankspace for blank lines, but 'cat -b' does not.  That seems far less intuitive to me from any of the descriptions.  It seems more consistent for 'cat -b' to always include leading blankspace or to never include, not to only do it for '-e'.
Comment 4 Sevan Janiyan 2016-08-05 16:22:54 UTC
(In reply to John Baldwin from comment #3)

> 1) The 'BSD' output from CSRG is the current one, not NetBSD's recent change.  The other output has been in place for 35 years.

That made me smile, <3
ok, the NetBSD change is nearly 10 years old. :)

> 2) The language is not clear (and I'd be fine with clarifying it), but what you are changing is to have 'cat -be' insert extra leading blankspace for blank lines, but 'cat -b' does not.

From the source code
/* -b implies -n */
/* -e implies -v */

Ignoring the -e flag & comparing the difference between -b & -n with the following in a text file called a.txt
a b c

1 2 3

x y z

cat -b a.txt produces
     1	a b c

     2	1 2 3

     3	x y z

cat -n a.txt produces
     1	a b c
     2	
     3	1 2 3
     4	
     5	x y z

so if -b implies -n, when invoked with -e, would you build on that or give another variant of output?

cat -be a.txt
     1  a b c$
        $
     2  1 2 3$
        $
     3  x y z$

or

cat -be f.txt
     1	a b c$
$
     2	1 2 3$
$
     3	x y z$
Comment 5 John Baldwin freebsd_committer freebsd_triage 2016-08-05 17:30:21 UTC
Pipe your non "-e" results through hd to see what I mean about -b not adding a prefix.  Right now, this will omit blank lines:

cat -b < foo | grep -v '^$'

because "plain" 'cat -b' doesn't modify the content of blank lines.  Right now, 'cat -be' only modifies each line by adding the trailing '$', it does not insert extra whitespace.  The problem is that I think arguments can be made for both interpretations, so I would err on the side of not changing things since you risk breaking existing scripts/setups.  I do think we should be more clear in documenting.
Comment 6 Sevan Janiyan 2016-08-05 18:07:43 UTC
(In reply to John Baldwin from comment #5)
> The problem is that I think arguments can be made for both interpretations, so I would err on the side of not changing things since you risk breaking existing scripts/setups.

that's a shame but I respect your wishes, sadly this creates a new split where NetBSD, OpenBSD & DragonFlyBSD produces output one way & FreeBSD another. Just as a heads up, the NetBSD test case for this behaviour did not exercise this functionality (there weren't any blank lines in the test case) but just tested that text was indented.
This has been corrected upstream in the NetBSD ATF tests so this issue may crop up again should your contrib/netbsd-tests but updated to incorporate the new test cases from NetBSD.
Comment 7 John Baldwin freebsd_committer freebsd_triage 2016-08-06 00:06:20 UTC
My view isn't the only one, but I'm just very hesitant to change the existing format.  bdrewery@ prefers the newer format at least, so he might push this in if you prod him enough.
Comment 8 Enji Cooper freebsd_committer 2016-08-12 06:34:09 UTC
Just to confirm, yes... it causes failures with the NetBSD tests:

$ svn info | grep ^URL:
URL: svn+ssh://ngie@repo.freebsd.org/base/projects/netbsd-tests-update-12/bin/cat/tests
$ kyua debug -k /usr/tests/bin/cat/Kyuafile cat_test:align
Executing command [ /bin/sh -c cat -be /usr/tests/bin/cat/d_align.in ]
Fail: stdout does not match golden output
--- /usr/tests/bin/cat/d_align.out      2016-08-12 06:31:54.211355000 +0000
+++ /tmp/kyua.atf-tester.dRY658/check.pFAOAC/stdout     2016-08-12 06:32:15.388825000 +0000
@@ -1,5 +1,5 @@
      1 a b c$
-       $
+$
      2 1 2 3$
-       $
+$
      3 x y z$
cat_test:align  ->  failed: atf-check failed; see the output of the test for details
Comment 9 commit-hook freebsd_committer 2016-08-13 02:53:24 UTC
A commit references this bug:

Author: ngie
Date: Sat Aug 13 02:53:02 UTC 2016
New revision: 304035
URL: https://svnweb.freebsd.org/changeset/base/304035

Log:
  Hack around output differences between FreeBSD and other BSDs
  with cat(1)

  cat -be on FreeBSD doesn't align the $ with the start of the line
  like NetBSD, et al's cat -be does

  PR:		210607
  Sponsored by:	EMC / Isilon Storage Division

Changes:
  projects/netbsd-tests-update-12/bin/cat/tests/Makefile
Comment 10 commit-hook freebsd_committer 2017-02-10 01:13:27 UTC
A commit references this bug:

Author: ngie
Date: Fri Feb 10 01:13:13 UTC 2017
New revision: 313498
URL: https://svnweb.freebsd.org/changeset/base/313498

Log:
  MFC r305358,r305449,r305451,r306367,r306397,r309474:

  This also contains a merge of ^/projects/netbsd-tests-update-12@r304035 .
  This change never hit ^/head because bin/cat's behavior was changed (on ^/head)
  to match NetBSD.

  PR:	210607

  r305358:

  Update contrib/netbsd-tests with new content from NetBSD

  This updates the snapshot from 09/30/2014 to 08/11/2016

  This brings in a number of new testcases from upstream, most
  notably:

  - bin/cat
  - lib/libc
  - lib/msun
  - lib/libthr
  - usr.bin/sort

  lib/libc/tests/stdio/open_memstream_test.c was moved to
  lib/libc/tests/stdio/open_memstream2_test.c to accomodate
  the new open_memstream test from NetBSD.

  Tested on:	amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox

  r305449:

  Install h_db to unbreak some of the lib/libc/db testcases after
  r305358

  r305451:

  Fix lib/libc/rpc test assumptions added in r305358

  - Require root in the tcp/udp subtests (it's needed on FreeBSD when
    registering services).
  - Skip the tests if service registration fails.

  r306367 (by br):

  Allow up to 6 arguments only on MIPS.

  r306397 (by br):

  Use right piece of code for FreeBSD.

  r309474:

  Don't build :strvis_locale if VIS_NOLOCALE is undefined

  The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features
  in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower
  in conditionally running the test instead of backporting the newer version of
  libc-vis

Changes:
_U  stable/10/
  stable/10/bin/cat/tests/Makefile
  stable/10/contrib/netbsd-tests/bin/cat/d_align.in
  stable/10/contrib/netbsd-tests/bin/cat/d_align.out
  stable/10/contrib/netbsd-tests/bin/cat/d_se_output.in
  stable/10/contrib/netbsd-tests/bin/cat/d_se_output.out
  stable/10/contrib/netbsd-tests/bin/cat/t_cat.sh
  stable/10/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command
  stable/10/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_arith.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_cmdsub.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_compexit.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_evaltested.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_exit.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_expand.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_fsplit.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_here.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_option.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_redir.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_redircloexec.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_set_e.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_shift.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_ulimit.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_varquote.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_varval.sh
  stable/10/contrib/netbsd-tests/bin/sh/t_wait.sh
  stable/10/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh
  stable/10/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue
  stable/10/contrib/netbsd-tests/dev/dm/h_dm.c
  stable/10/contrib/netbsd-tests/dev/fss/
  stable/10/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh
  stable/10/contrib/netbsd-tests/dev/sysmon/t_swwdog.c
  stable/10/contrib/netbsd-tests/dev/usb/
  stable/10/contrib/netbsd-tests/fs/common/fstest_lfs.c
  stable/10/contrib/netbsd-tests/fs/common/h_fsmacros.h
  stable/10/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c
  stable/10/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c
  stable/10/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c
  stable/10/contrib/netbsd-tests/fs/nfs/t_rquotad.sh
  stable/10/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
  stable/10/contrib/netbsd-tests/fs/vfs/t_io.c
  stable/10/contrib/netbsd-tests/fs/vfs/t_renamerace.c
  stable/10/contrib/netbsd-tests/fs/vfs/t_unpriv.c
  stable/10/contrib/netbsd-tests/fs/vfs/t_vnops.c
  stable/10/contrib/netbsd-tests/games/t_factor.sh
  stable/10/contrib/netbsd-tests/h_macros.h
  stable/10/contrib/netbsd-tests/include/sys/t_bitops.c
  stable/10/contrib/netbsd-tests/include/sys/t_cdefs.c
  stable/10/contrib/netbsd-tests/include/sys/t_pslist.c
  stable/10/contrib/netbsd-tests/include/sys/t_socket.c
  stable/10/contrib/netbsd-tests/include/t_paths.c
  stable/10/contrib/netbsd-tests/ipf/expected/n14
  stable/10/contrib/netbsd-tests/ipf/expected/n14_6
  stable/10/contrib/netbsd-tests/ipf/t_filter_parse.sh
  stable/10/contrib/netbsd-tests/ipf/t_nat_exec.sh
  stable/10/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c
  stable/10/contrib/netbsd-tests/kernel/kqueue/t_proc1.c
  stable/10/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
  stable/10/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
  stable/10/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
  stable/10/contrib/netbsd-tests/kernel/t_rnd.c
  stable/10/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c
  stable/10/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S
  stable/10/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S
  stable/10/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S
  stable/10/contrib/netbsd-tests/lib/libc/db/h_lfsr.c
  stable/10/contrib/netbsd-tests/lib/libc/db/t_db.sh
  stable/10/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/isqemu.h
  stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_nice.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_time.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_vis.c
  stable/10/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c
  stable/10/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c
  stable/10/contrib/netbsd-tests/lib/libc/net/t_servent.sh
  stable/10/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c
  stable/10/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c
  stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
  stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
  stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
  stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c
  stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
  stable/10/contrib/netbsd-tests/lib/libc/string/t_memset.c
  stable/10/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_bind.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_wait.c
  stable/10/contrib/netbsd-tests/lib/libc/time/t_strptime.c
  stable/10/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y
  stable/10/contrib/netbsd-tests/lib/libm/t_exp.c
  stable/10/contrib/netbsd-tests/lib/libm/t_fenv.c
  stable/10/contrib/netbsd-tests/lib/libm/t_fmod.c
  stable/10/contrib/netbsd-tests/lib/libm/t_hypot.c
  stable/10/contrib/netbsd-tests/lib/libm/t_log.c
  stable/10/contrib/netbsd-tests/lib/libm/t_pow.c
  stable/10/contrib/netbsd-tests/lib/libpthread/t_cond.c
  stable/10/contrib/netbsd-tests/lib/libpthread/t_mutex.c
  stable/10/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
  stable/10/contrib/netbsd-tests/lib/librumpclient/t_exec.sh
  stable/10/contrib/netbsd-tests/lib/librumpclient/t_fd.c
  stable/10/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh
  stable/10/contrib/netbsd-tests/lib/libusbhid/
  stable/10/contrib/netbsd-tests/lib/libutil/t_parsedate.c
  stable/10/contrib/netbsd-tests/net/arp/
  stable/10/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c
  stable/10/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c
  stable/10/contrib/netbsd-tests/net/icmp/t_forward.c
  stable/10/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh
  stable/10/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh
  stable/10/contrib/netbsd-tests/net/icmp/t_ping.c
  stable/10/contrib/netbsd-tests/net/icmp/t_ping2.sh
  stable/10/contrib/netbsd-tests/net/if/ifconf.c
  stable/10/contrib/netbsd-tests/net/if/t_ifconf.sh
  stable/10/contrib/netbsd-tests/net/if/t_ifconfig.sh
  stable/10/contrib/netbsd-tests/net/if_bridge/t_bridge.sh
  stable/10/contrib/netbsd-tests/net/if_gif/
  stable/10/contrib/netbsd-tests/net/if_pppoe/
  stable/10/contrib/netbsd-tests/net/if_tap/
  stable/10/contrib/netbsd-tests/net/in_cksum/
  stable/10/contrib/netbsd-tests/net/mcast/
  stable/10/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh
  stable/10/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh
  stable/10/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh
  stable/10/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh
  stable/10/contrib/netbsd-tests/net/mpls/t_rfc4182.sh
  stable/10/contrib/netbsd-tests/net/ndp/
  stable/10/contrib/netbsd-tests/net/net/t_forwarding.sh
  stable/10/contrib/netbsd-tests/net/net/t_ipaddress.sh
  stable/10/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh
  stable/10/contrib/netbsd-tests/net/net/t_ipv6address.sh
  stable/10/contrib/netbsd-tests/net/net/t_tcp.c
  stable/10/contrib/netbsd-tests/net/route/t_change.sh
  stable/10/contrib/netbsd-tests/net/route/t_flags.sh
  stable/10/contrib/netbsd-tests/net/route/t_flags6.sh
  stable/10/contrib/netbsd-tests/net/route/t_route.sh
  stable/10/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
  stable/10/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c
  stable/10/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c
  stable/10/contrib/netbsd-tests/rump/rumpkern/t_sp.sh
  stable/10/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh
  stable/10/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c
  stable/10/contrib/netbsd-tests/sbin/gpt/
  stable/10/contrib/netbsd-tests/sbin/resize_ffs/common.sh
  stable/10/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh
  stable/10/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh
  stable/10/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh
  stable/10/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh
  stable/10/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh
  stable/10/contrib/netbsd-tests/sbin/sysctl/t_perm.sh
  stable/10/contrib/netbsd-tests/share/mk/t_lib.sh
  stable/10/contrib/netbsd-tests/share/mk/t_prog.sh
  stable/10/contrib/netbsd-tests/share/mk/t_test.sh
  stable/10/contrib/netbsd-tests/sys/net/
  stable/10/contrib/netbsd-tests/sys/netatalk/
  stable/10/contrib/netbsd-tests/sys/netinet/
  stable/10/contrib/netbsd-tests/sys/netinet6/
  stable/10/contrib/netbsd-tests/usr.bin/cc/t_hello.sh
  stable/10/contrib/netbsd-tests/usr.bin/config/d_min
  stable/10/contrib/netbsd-tests/usr.bin/config/support/conf/files
  stable/10/contrib/netbsd-tests/usr.bin/config/t_config.sh
  stable/10/contrib/netbsd-tests/usr.bin/gdb/
  stable/10/contrib/netbsd-tests/usr.bin/ld/
  stable/10/contrib/netbsd-tests/usr.bin/make/t_make.sh
  stable/10/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec
  stable/10/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh
  stable/10/contrib/netbsd-tests/usr.bin/sed/t_sed.sh
  stable/10/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt
  stable/10/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt
  stable/10/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c
  stable/10/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c
  stable/10/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh
  stable/10/lib/libc/tests/db/Makefile
  stable/10/lib/libc/tests/hash/Makefile
  stable/10/lib/libc/tests/inet/Makefile
  stable/10/lib/libc/tests/stdio/Makefile
  stable/10/lib/libc/tests/stdio/open_memstream2_test.c
  stable/10/lib/libc/tests/stdio/open_memstream_test.c
  stable/10/lib/libc/tests/stdlib/Makefile
  stable/10/lib/libc/tests/sys/Makefile
  stable/10/lib/msun/tests/Makefile
Comment 11 commit-hook freebsd_committer 2017-09-21 14:15:16 UTC
A commit references this bug:

Author: sevan
Date: Thu Sep 21 14:14:49 UTC 2017
New revision: 323865
URL: https://svnweb.freebsd.org/changeset/base/323865

Log:
  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
  Submitted by:	myself
  Reviewed by:	bdrewery
  Obtained from:	NetBSD
  Relnotes:	yes
  Differential Revision:	https://reviews.freebsd.org/D12432

Changes:
  head/bin/cat/cat.c
  head/bin/cat/tests/Makefile
Comment 12 commit-hook freebsd_committer 2018-03-08 07:51:01 UTC
A commit references this bug:

Author: eadler
Date: Thu Mar  8 07:50:11 UTC 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

Changes:
_U  stable/11/
  stable/11/bin/cat/cat.c
  stable/11/bin/cat/tests/Makefile
Comment 13 commit-hook freebsd_committer 2018-03-10 08:51:25 UTC
A commit references this bug:

Author: eadler
Date: Sat Mar 10 08:51:02 UTC 2018
New revision: 330738
URL: https://svnweb.freebsd.org/changeset/base/330738

Log:
  Revert MFC of r323865

  While this behavior can be viewed as a bug fix, due to the fundamental
  nature of cat(1), leave this change only for a major version.

  PR:	210607
  Requested by:	sevan

Changes:
_U  stable/11/
  stable/11/bin/cat/cat.c
  stable/11/bin/cat/tests/Makefile