From ac181bf548a3dd1aabaf8263d255936f66866cc7 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 21 Jul 2017 08:33:25 +0100 Subject: 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. --- libbb/appletlib.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'libbb') 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) if (applet_name[0] == '-') applet_name++; if (ENABLE_PLATFORM_MINGW32) { - const char *applet_name_env = getenv("BUSYBOX_APPLET_NAME"); - if (applet_name_env && *applet_name_env) { - applet_name = applet_name_env; - unsetenv("BUSYBOX_APPLET_NAME"); - } - else if ( argv[1] && argv[2] && strcmp(argv[1], "--busybox") == 0 ) { + if ( argv[1] && argv[2] && strcmp(argv[1], "--busybox") == 0 ) { argv += 2; applet_name = argv[0]; } -- cgit v1.2.3-55-g6feb