Fix invocation of `-/bin/sh' (bug #1209).
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
-- Optimized gzip.c, shrinking it be ~1.5k
|
-- Optimized gzip.c, shrinking it be ~1.5k
|
||||||
* Matt Kraai
|
* Matt Kraai
|
||||||
-- Fix sed s/[/]// handling (closes: #1208).
|
-- Fix sed s/[/]// handling (closes: #1208).
|
||||||
|
-- Fix `-/bin/sh' invocation (closes: #1209).
|
||||||
|
|
||||||
|
|
||||||
-Erik Andersen, --not yet released--
|
-Erik Andersen, --not yet released--
|
||||||
|
@ -69,16 +69,16 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
const char *s;
|
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++ == '/')
|
if (*s++ == '/')
|
||||||
applet_name = 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_LOCALE_SUPPORT
|
||||||
#ifdef BB_INIT
|
#ifdef BB_INIT
|
||||||
if(getpid()!=1) /* Do not set locale for `init' */
|
if(getpid()!=1) /* Do not set locale for `init' */
|
||||||
|
12
busybox.c
12
busybox.c
@ -69,16 +69,16 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
const char *s;
|
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++ == '/')
|
if (*s++ == '/')
|
||||||
applet_name = 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_LOCALE_SUPPORT
|
||||||
#ifdef BB_INIT
|
#ifdef BB_INIT
|
||||||
if(getpid()!=1) /* Do not set locale for `init' */
|
if(getpid()!=1) /* Do not set locale for `init' */
|
||||||
|
Reference in New Issue
Block a user