[Toybox] [PATCH] head: Fix not -123 options

Felix Janda felix.janda at posteo.de
Sat Mar 28 14:31:13 PDT 2015


---
 toys/posix/head.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/toys/posix/head.c b/toys/posix/head.c
index 42f945b..8e77b01 100644
--- a/toys/posix/head.c
+++ b/toys/posix/head.c
@@ -56,6 +56,7 @@ void head_main(void)
   if (arg && *arg == '-' && arg[1]) {
     TT.lines = atolx(arg+1);
     toys.optc--;
+    toys.optargs++;
   }
-  loopfiles(toys.optargs+!!arg, do_head);
+  loopfiles(toys.optargs, do_head);
 }
-- 
2.0.5

 1427578273.0


More information about the Toybox mailing list