Fix invocation of `-/bin/sh' (bug #1209).
diff --git a/busybox.c b/busybox.c
index 7a220f7..33efb5d 100644
--- a/busybox.c
+++ b/busybox.c
@@ -69,16 +69,16 @@
{
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' */