Hi,

xargs' -L switch isn't working when using -0 flag.

Here's a demonstration:

$ cd /tmp/
$ mkdir foo bar
$ find /tmp/foo /tmp/bar | xargs -L 1 echo
/tmp/foo
/tmp/bar
$ find /tmp/foo /tmp/bar -print0 | xargs -0 -L 1 echo
/tmp/foo /tmp/bar

Tested also on OS X and Linux and they print two lines with -0.

Index: xargs.c
===================================================================
RCS file: /cvs/src/usr.bin/xargs/xargs.c,v
retrieving revision 1.26
diff -u -r1.26 xargs.c
--- xargs.c     27 Oct 2009 23:59:50 -0000      1.26
+++ xargs.c     2 Feb 2010 16:45:26 -0000
@@ -259,6 +259,7 @@
                        goto addch;
                goto arg2;
        case '\0':
+               count++;
                if (zflag)
                        goto arg2;
                goto addch;

Reply via email to