The "re-exec to regain root permissions" logic broke the error message when calling...
authorRob Landley <rob@landley.net>
Sun, 30 Nov 2014 03:11:34 +0000 (21:11 -0600)
committerRob Landley <rob@landley.net>
Sun, 30 Nov 2014 03:11:34 +0000 (21:11 -0600)
It would say "no such command" when it should say "not root".

main.c

diff --git a/main.c b/main.c
index ed6706a..eefebf9 100644 (file)
--- a/main.c
+++ b/main.c
@@ -149,7 +149,7 @@ void toybox_main(void)
 
   toys.which = toy_list;
   if (toys.argv[1]) {
-    toys.optc = 0;
+    toys.optc = toys.recursion = 0;
     toy_exec(toys.argv+1);
     if (toys.argv[1][0] == '-') goto list;