diff options
author | Elliott Hughes <enh@google.com> | 2019-07-08 13:31:48 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-07-11 21:28:50 -0500 |
commit | 34f095fcbf0829719f9a130a359ebf2a3e223ca0 (patch) | |
tree | b5b6d4a114563c7bc54dbfcc75c06327e90dd0ea | |
parent | 4be57ee021b3d3c8caf29af85261d7edcce227fb (diff) | |
download | toybox-34f095fcbf0829719f9a130a359ebf2a3e223ca0.tar.gz |
xargs: bug compatibility with BSD/busybox/findutils.
The other xargs implementations in the wild don't seem to count the
space taken by each `char *`. Go for bug compatibility unless future
experience proves that to be a bad idea.
-rw-r--r-- | toys/posix/xargs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/posix/xargs.c b/toys/posix/xargs.c index 9a3e9dae..6f8c76fb 100644 --- a/toys/posix/xargs.c +++ b/toys/posix/xargs.c @@ -76,7 +76,8 @@ static char *handle_entries(char *data, char **entry) if (!*s) break; save = s; - TT.bytes += sizeof(char *); + // We ought to add sizeof(char *) to TT.bytes to be correct, but we don't + // for bug compatibility with busybox 1.30.1 and findutils 4.7.0. for (;;) { if (++TT.bytes >= TT.s && TT.s) return save; |