From 2af141a2c069c56d56f110414f600f3a38ad8617 Mon Sep 17 00:00:00 2001
From: Ron Yorston <rmy@pobox.com>
Date: Wed, 30 Aug 2023 13:07:13 +0100
Subject: ash: changes to login shell functionality

Upstream BusyBox supports the usual Unix functionality where the
login process adds a '-' prefix to the shell's argv[0].  Since
busybox-w32 doesn't have a login process this serves no purpose
and can be removed.

Instead it would be useful to have a way to invoke a login shell
without requiring any arguments.  Advantages would be:

- easier to configure busybox-w32 'ash' as the SSH login shell;

- double clicking on a shell binary could start a login shell.

Add 'lash' as an alias for 'ash' which starts a login shell without
requiring the '-l' option.

Saves 16 bytes.
---
 libbb/appletlib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'libbb')

diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index bf9ae4603..6b610743a 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1379,9 +1379,10 @@ int main(int argc UNUSED_PARAM, char **argv)
 		argv++;
 # endif
 	applet_name = argv[0];
+# if !ENABLE_PLATFORM_MINGW32
 	if (applet_name[0] == '-')
 		applet_name++;
-# if ENABLE_PLATFORM_MINGW32
+# else
 	str_tolower(argv[0]);
 	bs_to_slash(argv[0]);
 	if (has_exe_suffix_or_dot(argv[0])) {
-- 
cgit v1.2.3-55-g6feb