1
0
mirror of git://git.suckless.org/sbase synced 2024-12-21 22:50:16 +00:00

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

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;