aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-06-21 04:56:24 +0000
committerEric Andersen <andersen@codepoet.org>2001-06-21 04:56:24 +0000
commitfa2661f2e5a95f0efd1f019c8ad8742af7bcb55b (patch)
treec8c65e09e7b4ddd10f031442ff63727f0ed46b04
parentaff5e2eaef3a625bfa7760e59a6cf29de5cb0282 (diff)
downloadbusybox-w32-fa2661f2e5a95f0efd1f019c8ad8742af7bcb55b.tar.gz
busybox-w32-fa2661f2e5a95f0efd1f019c8ad8742af7bcb55b.tar.bz2
busybox-w32-fa2661f2e5a95f0efd1f019c8ad8742af7bcb55b.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
-rw-r--r--applets/busybox.c7
-rw-r--r--busybox.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index f3d0c4c2f..7a220f7b0 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -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
diff --git a/busybox.c b/busybox.c
index f3d0c4c2f..7a220f7b0 100644
--- a/busybox.c
+++ b/busybox.c
@@ -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