[Toybox] [PATCH] xargs: various fixes.

enh enh at google.com
Wed Oct 9 14:54:52 PDT 2019


Don't run the command with no arguments if we run out of input but
have already run the command at least once. The implementation of "run
the command at least once (unless -r was supplied)" wasn't taking into
account whether or not this was our first time round the loop.

Fix the exit value, and the -- already documented but not implemented --
behavior if a child exits with status 255.

Also extend the tests to cover these cases, plus cases I broke while
coming up with the fix. Add more tests to convince myself that we've
correctly interpreted how -s is supposed to behave, and fix the corner
cases at the bottom end of the range.

This fixes some issues we were seeing trying to build the Android SDK
for (and more importantly, on) macOS.
---
 tests/xargs.test   | 27 +++++++++++++++++++++------
 toys/posix/xargs.c | 41 +++++++++++++++++++++++++++++------------
 2 files changed, 50 insertions(+), 18 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xargs-various-fixes.patch
Type: text/x-patch
Size: 7061 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191009/00c2e533/attachment-0002.bin>


More information about the Toybox mailing list