aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/appletlib.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 14b21f827..5425f736e 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -834,13 +834,16 @@ int main(int argc UNUSED_PARAM, char **argv)
834 unsetenv("BUSYBOX_APPLET_NAME"); 834 unsetenv("BUSYBOX_APPLET_NAME");
835 } 835 }
836 else { 836 else {
837 int i, len = strlen(applet_name); 837 char *s = argv[0];
838 if (len > 4 && !strcmp(applet_name+len-4, ".exe")) { 838 int i, len = strlen(s);
839
840 for ( i=0; i < len; ++i ) {
841 s[i] = tolower(s[i]);
842 }
843 if (len > 4 && !strcmp(s+len-4, ".exe")) {
839 len -= 4; 844 len -= 4;
840 argv[0][applet_name-argv[0]+len] = '\0'; 845 s[len] = '\0';
841 } 846 }
842 for (i = 0; i < len; i++)
843 argv[0][applet_name-argv[0]+i] = tolower(applet_name[i]);
844 } 847 }
845 } 848 }
846 applet_name = bb_basename(applet_name); 849 applet_name = bb_basename(applet_name);