diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-06-21 08:56:24 +0400 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-06-21 08:56:24 +0400 |
commit | fa2661f2e5a95f0efd1f019c8ad8742af7bcb55b (patch) | |
tree | c8c65e09e7b4ddd10f031442ff63727f0ed46b04 /busybox.c | |
parent | aff5e2eaef3a625bfa7760e59a6cf29de5cb0282 (diff) |
Per a suggestion from Tom Oehser, fix up the leading-hyphen hack to
make it general. Now all leading single hyphens are ignored for
purposed of applet name matching, while argv[0] is still passed
unaltered to applets, so leading-hyphen sensitive applets (such as sh)
can react accordingly.
-Erik
Diffstat (limited to 'busybox.c')
-rw-r--r-- | busybox.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -74,13 +74,10 @@ int main(int argc, char **argv) applet_name = s; } -#ifdef BB_SH - /* Add in a special case hack -- whenever **argv == '-' - * (i.e., '-su' or '-sh') always invoke the shell */ + /* Add in a special case hack for a leading hyphen */ if (**argv == '-' && *(*argv+1)!= '-') { - applet_name = "sh"; + applet_name = (*argv+1); } -#endif #ifdef BB_LOCALE_SUPPORT #ifdef BB_INIT |