MFC 1.22: Fix -0 vs -L/-I processing, mainly so that 'xargs -0 -I []' will

do something sensible (namely: treat then '\0' as the EOL character, when
deciding what "a line" is for -N).  Note that  -I implies -N.

MFC after:	3 days
This commit is contained in:
gad 2005-02-27 01:35:54 +00:00
parent 89f7f70b5a
commit 35a8edad83

View File

@ -272,13 +272,20 @@ parse_input(int argc, char *argv[])
goto addch;
goto arg2;
case '\0':
if (zflag)
if (zflag) {
/*
* Increment 'count', so that nulls will be treated
* as end-of-line, as well as end-of-argument. This
* is needed so -0 works properly with -I and -L.
*/
count++;
goto arg2;
}
goto addch;
case '\n':
count++;
if (zflag)
goto addch;
count++; /* Indicate end-of-line (used by -L) */
/* Quotes do not escape newlines. */
arg1: if (insingle || indouble)