From 449377aa6a8cb6b75d3b6aff6af7aade3174b2f3 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Mon, 27 Aug 2001 15:02:32 +0000 Subject: Fix invocation of `-/bin/sh' (bug #1209). --- applets/busybox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'applets/busybox.c') diff --git a/applets/busybox.c b/applets/busybox.c index 7a220f7b0..33efb5d84 100644 --- a/applets/busybox.c +++ b/applets/busybox.c @@ -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' */ -- cgit v1.2.3