ls: allow -w0 to mean no limit on line length
commit0e997681d4497fe9ba6db035909e413a5af050a9
authorPádraig Brady <P@draigBrady.com>
Tue, 20 Oct 2015 13:42:39 +0000 (20 14:42 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 Oct 2015 00:40:02 +0000 (21 01:40 +0100)
tree3a6e4bbf904902dbb71124567942198e3142147a
parent069961924efb64349914df085d6b0ac76bdaf7ae
ls: allow -w0 to mean no limit on line length

* src/ls.c (print_with_separator): Renamed from print_with_commas,
and parameterized to accept the separator to print.
Also fix an edge case where '\n' not printed when
the POS variable overflows SIZE_MAX.
(print_current_files): Degenerate -x and -C to using the
cheaper print_with_separator() in the -w0 case.
* doc/coreutils.texi (ls invocation): Document the new feature.
* tests/ls/w-option.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/21325
NEWS
doc/coreutils.texi
src/ls.c
tests/local.mk
tests/ls/w-option.sh [new file with mode: 0755]