aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-06-29 20:20:14 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-06-29 20:20:14 +0000
commit3bb9e85f417606c5a26282e325eca6dde75f04d0 (patch)
tree51ac3363a0e3e2eb955b8d3e8c5d6548e05f7e16 /applets
parent8b19b59288c1fca6927a519e6db3f6df09cd3c80 (diff)
downloadbusybox-w32-3bb9e85f417606c5a26282e325eca6dde75f04d0.tar.gz
busybox-w32-3bb9e85f417606c5a26282e325eca6dde75f04d0.tar.bz2
busybox-w32-3bb9e85f417606c5a26282e325eca6dde75f04d0.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@726 69ca8d6d-28ef-0310-b511-8ec308f3f277
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)
479 479
480 *argv = name; 480 *argv = name;
481 481
482#ifdef BB_SH
483 /* Add in a special case hack -- whenever **argv == '-'
484 * (i.e. '-su' or '-sh') always invoke the shell */
485 if (**argv == '-')
486 exit(((*(shell_main)) (argc, argv)));
487#endif
488
482 while (a->name != 0) { 489 while (a->name != 0) {
483 if (strcmp(name, a->name) == 0) { 490 if (strcmp(name, a->name) == 0) {
484 exit(((*(a->main)) (argc, argv))); 491 exit(((*(a->main)) (argc, argv)));