aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-04-01 18:18:46 -0500
committerRob Landley <rob@landley.net>2014-04-01 18:18:46 -0500
commit52ab00b60863baf995522da1a638df4d6e9b0e8b (patch)
treee82756db9ca3148edcc52f5c009ca1d594f94ff4
parent5b405827a2fa4c928c488f3e7b0197dfec60dcc2 (diff)
downloadtoybox-52ab00b60863baf995522da1a638df4d6e9b0e8b.tar.gz
bugfix: the multiplexer increments optc and then the command the multiplexer runs increments it further, resulting in a wrong count. Fix: zero it.
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index 19600fcc..92ec89fa 100644
--- a/main.c
+++ b/main.c
@@ -132,6 +132,7 @@ void toybox_main(void)
toys.which = toy_list;
if (toys.argv[1]) {
+ toys.optc = 0;
toy_exec(toys.argv+1);
if (toys.argv[1][0] == '-') goto list;