aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-06-29 20:20:14 +0000
committerEric Andersen <andersen@codepoet.org>2000-06-29 20:20:14 +0000
commit5d41d60f1e78aceb92555596c3a58c13c65d4e5b (patch)
tree51ac3363a0e3e2eb955b8d3e8c5d6548e05f7e16 /applets
parent2e1148b2393b1bcb72804a0c0de1408ca02a0189 (diff)
downloadbusybox-5d41d60f1e78aceb92555596c3a58c13c65d4e5b.tar.gz
Added support for being a login shell, so things like '-su' or '-sh' (stuff
where argv[0][0]=='-') will now always invoke the shell. Now you can use BusyBox as a login shell. -Erik
Diffstat (limited to 'applets')
-rw-r--r--applets/busybox.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index 48ca05408..486ef4d77 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -479,6 +479,13 @@ int main(int argc, char **argv)
*argv = name;
+#ifdef BB_SH
+ /* Add in a special case hack -- whenever **argv == '-'
+ * (i.e. '-su' or '-sh') always invoke the shell */
+ if (**argv == '-')
+ exit(((*(shell_main)) (argc, argv)));
+#endif
+
while (a->name != 0) {
if (strcmp(name, a->name) == 0) {
exit(((*(a->main)) (argc, argv)));