diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-21 04:56:24 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-21 04:56:24 +0000 |
commit | b15dee1301a4c555b7b29e2b493d61a97e3b5427 (patch) | |
tree | c8c65e09e7b4ddd10f031442ff63727f0ed46b04 /busybox.c | |
parent | 58b48c1204cb794429ac35e36436ee09ea341a02 (diff) | |
download | busybox-w32-b15dee1301a4c555b7b29e2b493d61a97e3b5427.tar.gz busybox-w32-b15dee1301a4c555b7b29e2b493d61a97e3b5427.tar.bz2 busybox-w32-b15dee1301a4c555b7b29e2b493d61a97e3b5427.zip |
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
git-svn-id: svn://busybox.net/trunk/busybox@2867 69ca8d6d-28ef-0310-b511-8ec308f3f277
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) | |||
74 | applet_name = s; | 74 | applet_name = s; |
75 | } | 75 | } |
76 | 76 | ||
77 | #ifdef BB_SH | 77 | /* Add in a special case hack for a leading hyphen */ |
78 | /* Add in a special case hack -- whenever **argv == '-' | ||
79 | * (i.e., '-su' or '-sh') always invoke the shell */ | ||
80 | if (**argv == '-' && *(*argv+1)!= '-') { | 78 | if (**argv == '-' && *(*argv+1)!= '-') { |
81 | applet_name = "sh"; | 79 | applet_name = (*argv+1); |
82 | } | 80 | } |
83 | #endif | ||
84 | 81 | ||
85 | #ifdef BB_LOCALE_SUPPORT | 82 | #ifdef BB_LOCALE_SUPPORT |
86 | #ifdef BB_INIT | 83 | #ifdef BB_INIT |