diff options
author | Matt Kraai <kraai@debian.org> | 2001-08-27 19:02:32 +0400 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-08-27 19:02:32 +0400 |
commit | 449377aa6a8cb6b75d3b6aff6af7aade3174b2f3 (patch) | |
tree | 44e814ac04f10384b2f87986a2c2faa6b3f8e9a6 /busybox.c | |
parent | 80f6d55836963f4e85c297f2901161d0ff69b4cb (diff) |
Fix invocation of `-/bin/sh' (bug #1209).
Diffstat (limited to 'busybox.c')
-rw-r--r-- | busybox.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -69,16 +69,16 @@ int main(int argc, char **argv) { const char *s; - for (s = applet_name = argv[0]; *s != '\0';) { + applet_name = argv[0]; + + if (applet_name[0] == '-') + applet_name++; + + for (s = applet_name; *s != '\0';) { if (*s++ == '/') applet_name = s; } - /* Add in a special case hack for a leading hyphen */ - if (**argv == '-' && *(*argv+1)!= '-') { - applet_name = (*argv+1); - } - #ifdef BB_LOCALE_SUPPORT #ifdef BB_INIT if(getpid()!=1) /* Do not set locale for `init' */ |