aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-07-08 13:31:48 -0700
committerRob Landley <rob@landley.net>2019-07-11 21:28:50 -0500
commit34f095fcbf0829719f9a130a359ebf2a3e223ca0 (patch)
treeb5b6d4a114563c7bc54dbfcc75c06327e90dd0ea /toys/posix
parent4be57ee021b3d3c8caf29af85261d7edcce227fb (diff)
downloadtoybox-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.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/xargs.c3
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;