From 34f095fcbf0829719f9a130a359ebf2a3e223ca0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 8 Jul 2019 13:31:48 -0700 Subject: 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. --- toys/posix/xargs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'toys/posix/xargs.c') 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; -- cgit v1.2.3