xargs: Don't print trailing spaces when -t is set

This commit is contained in:
sin 2015-04-21 17:59:08 +01:00
parent 10b57e8a3d
commit 2fc73e410c

View File

@ -160,12 +160,15 @@ static void
spawn(void) spawn(void)
{ {
int savederrno; int savederrno;
int first = 1;
char **p; char **p;
if (tflag) { if (tflag) {
for (p = cmd; *p; p++) { for (p = cmd; *p; p++) {
if (!first)
fputc(' ', stderr);
fputs(*p, stderr); fputs(*p, stderr);
fputc(' ', stderr); first = 0;
} }
fputc('\n', stderr); fputc('\n', stderr);
} }