wc: avoid ambiguous output with '\n' in file names
commit3ed89ae9324026660dfefb5e482e91b8acc5262d
authorPádraig Brady <P@draigBrady.com>
Sat, 9 Jan 2016 01:38:30 +0000 (9 01:38 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 13 Jan 2016 11:11:36 +0000 (13 11:11 +0000)
tree77025a5cb78df0fd5ffad2929a3023181b37c4a1
parent672663e1b0afd68a10d991527fd5021c40c99acc
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
src/wc.c
tests/misc/wc-files0.sh