From 3ed89ae9324026660dfefb5e482e91b8acc5262d Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Sat, 9 Jan 2016 01:38:30 +0000 Subject: wc: avoid ambiguous output with '\n' in file names * src/wc.c (write_counts): Shell escape the file name if it contains '\n' so only a single line per file is output. * tests/misc/wc-files0.sh: Add a test case. * NEWS: Mention the improvement. --- NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 1c214d520..a57c4b36f 100644 --- a/NEWS +++ b/NEWS @@ -94,6 +94,9 @@ GNU coreutils NEWS -*- outline -*- pseudo file systems "bpf_fs", "btrfs_test", "nsfs", "overlayfs" and "tracefs", and remote file system "acfs". + wc now ensures a single line per file for counts on standard output, + by quoting names containing '\n' characters; appropriate for use in a shell. + * Noteworthy changes in release 8.24 (2015-07-03) [stable] -- cgit v1.2.3-70-g09d2