This was embarrassing... A build script that was using xargs -I silently
started to ignore -I when we switched over to toybox xargs. The owner of
the script has rewritten it to use the shell read builtin instead, but
it's pretty unhelpful to silently ignore an option that radically
changes how xargs behaves. (The -I behavior sounds sufficiently
different from normal behavior that I'm not sure I've understood, and am
just sending this cleanup rather than actually implementing -I correctly.)

Bug: http://b/137832162
---
 toys/posix/xargs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
From baeca37f881f5352560727ca323f1f7f371e2253 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Thu, 18 Jul 2019 13:41:46 -0700
Subject: [PATCH] xargs: don't pretend to support -I.

This was embarrassing... A build script that was using xargs -I silently
started to ignore -I when we switched over to toybox xargs. The owner of
the script has rewritten it to use the shell read builtin instead, but
it's pretty unhelpful to silently ignore an option that radically
changes how xargs behaves. (The -I behavior sounds sufficiently
different from normal behavior that I'm not sure I've understood, and am
just sending this cleanup rather than actually implementing -I correctly.)

Bug: http://b/137832162
---
 toys/posix/xargs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/toys/posix/xargs.c b/toys/posix/xargs.c
index 6f8c76fb..12af9125 100644
--- a/toys/posix/xargs.c
+++ b/toys/posix/xargs.c
@@ -5,10 +5,11 @@
  * See http://opengroup.org/onlinepubs/9699919799/utilities/xargs.html
  *
  * TODO: Rich's whitespace objection, env size isn't fixed anymore.
- * TODO: -x	Exit if can't fit everything in one command
+ * TODO: -I	Insert mode
  * TODO: -L	Max number of lines of input per command
+ * TODO: -x	Exit if can't fit everything in one command
 
-USE_XARGS(NEWTOY(xargs, "^I:E:ptrn#<1s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_XARGS(NEWTOY(xargs, "^E:ptrn#<1s#0[!0E]", TOYFLAG_USR|TOYFLAG_BIN))
 
 config XARGS
   bool "xargs"
@@ -42,7 +43,7 @@ config XARGS_PEDANTIC
 
 GLOBALS(
   long s, n;
-  char *E, *I;
+  char *E;
 
   long entries, bytes;
   char delim;
-- 
2.22.0.657.g960e92d24f-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to