diff options
author | Rob Landley <rob@landley.net> | 2015-02-07 16:17:44 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-02-07 16:17:44 -0600 |
commit | c0045207a7cd3bc11aace920d895c69b027c16af (patch) | |
tree | 5cee9d0fc3013c62800c0402f52f6f8cac9405cd /main.c | |
parent | a48cfba9520a8ad9bf1308dcbac3fc6ee23894ba (diff) | |
download | toybox-c0045207a7cd3bc11aace920d895c69b027c16af.tar.gz |
Make toy_exec() check if argc is in optargs and deal with it there so we don't need a separate xexec_optargs().
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -127,6 +127,9 @@ void toy_exec(char *argv[]) { struct toy_list *which; + // don't blank old optargs if our new argc lives in the old optargs. + if (argv>=toys.optargs && argv<=toys.optargs+toys.optc) toys.optargs = 0; + // Return if we can't find it, or need to re-exec to acquire root, // or if stack depth is getting silly. if (!(which = toy_find(argv[0]))) return; |