xargs: Read full lines is -I

POSIX specifies that when -I is used then arguments are delimited
only by newlines.
This commit is contained in:
Roberto E. Vargas Caballero 2023-09-22 14:19:36 +02:00
parent fc85dc819d
commit 2cbf61dff9
1 changed files with 6 additions and 1 deletions

View File

@ -111,7 +111,11 @@ poparg(void)
return NULL;
while ((ch = inputc()) != EOF) {
switch (ch) {
case ' ': case '\t': case '\n':
case ' ':
case '\t':
if (Iflag)
goto fill;
case '\n':
goto out;
case '\'':
if (parsequote('\'') < 0)
@ -126,6 +130,7 @@ poparg(void)
eprintf("backslash at EOF\n");
break;
default:
fill:
fillargbuf(ch);
argbpos++;
break;