busybox/findutils
Ron Yorston 1ff7002b1d xargs: fix handling of quoted arguments, closes 11441
As reported in bug 11441 when presented with a large number of quoted
arguments xargs can return 'argument line too long':

   seq 10000 29999 | sed -e 's/^/"/' -e 's/$/"/' | busybox xargs echo

This happens because the variant of process_stdin() which handles quoted
arguments doesn't preserve state between calls.  If the allowed number
of characters is exceeded part way through a quoted argument the next
call to process_stdin() incorrectly treats the terminating quote as a
starting quote, thus quoting all of the argument separators.

function                                             old     new   delta
process_stdin                                        274     303     +29
xargs_main                                           731     745     +14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 43/0)               Total: 43 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-01-29 14:39:13 +01:00
..
Config.src restore documentation on the build config language 2018-06-06 15:16:48 +02:00
find.c find: implement -empty 2019-09-12 12:04:34 +02:00
grep.c grep: add -R 2019-11-27 17:11:09 +01:00
Kbuild.src *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
xargs.c xargs: fix handling of quoted arguments, closes 11441 2020-01-29 14:39:13 +01:00