mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-03 12:35:02 +00:00
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:
parent
789f03ceb4
commit
46793db95b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142604
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user