aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-07-21 08:33:25 +0100
committerRon Yorston <rmy@pobox.com>2017-07-21 08:33:25 +0100
commitac181bf548a3dd1aabaf8263d255936f66866cc7 (patch)
treed8142b74b8567a1ca2e45503959b22cbd1858d25 /libbb
parent304e170c10b459bf6913da2924f8b362f104884d (diff)
downloadbusybox-w32-ac181bf548a3dd1aabaf8263d255936f66866cc7.tar.gz
busybox-w32-ac181bf548a3dd1aabaf8263d255936f66866cc7.tar.bz2
busybox-w32-ac181bf548a3dd1aabaf8263d255936f66866cc7.zip
win32: simplify spawning applets
The original WIN32 code used the BUSYBOX_APPLET_NAME environment variable to pass the applet name to the spawned process. This was based on the (apparently) mistaken idea that WIN32 would replace argv[0] with the path to the executable.
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 34b73afa5..172c29611 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1106,12 +1106,7 @@ int main(int argc UNUSED_PARAM, char **argv)
1106 if (applet_name[0] == '-') 1106 if (applet_name[0] == '-')
1107 applet_name++; 1107 applet_name++;
1108 if (ENABLE_PLATFORM_MINGW32) { 1108 if (ENABLE_PLATFORM_MINGW32) {
1109 const char *applet_name_env = getenv("BUSYBOX_APPLET_NAME"); 1109 if ( argv[1] && argv[2] && strcmp(argv[1], "--busybox") == 0 ) {
1110 if (applet_name_env && *applet_name_env) {
1111 applet_name = applet_name_env;
1112 unsetenv("BUSYBOX_APPLET_NAME");
1113 }
1114 else if ( argv[1] && argv[2] && strcmp(argv[1], "--busybox") == 0 ) {
1115 argv += 2; 1110 argv += 2;
1116 applet_name = argv[0]; 1111 applet_name = argv[0];
1117 } 1112 }