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:
Garance A Drosehn 2005-02-27 01:35:54 +00:00
parent 789f03ceb4
commit 46793db95b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142604

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)