diff options
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 1232d97c9..1f9968f10 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1410,6 +1410,18 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
1410 | if (s) | 1410 | if (s) |
1411 | *s = '\0'; | 1411 | *s = '\0'; |
1412 | } | 1412 | } |
1413 | |||
1414 | if (windows_env()) { | ||
1415 | /* remove single trailing separator from PATH */ | ||
1416 | for (char **envp = environ; envp && *envp; envp++) { | ||
1417 | if (is_prefixed_with_case(*envp, "PATH=")) { | ||
1418 | char *end = last_char_is(*envp, ';'); | ||
1419 | if (end && end[-1] != ';') | ||
1420 | *end = '\0'; | ||
1421 | break; | ||
1422 | } | ||
1423 | } | ||
1424 | } | ||
1413 | # endif | 1425 | # endif |
1414 | applet_name = bb_basename(applet_name); | 1426 | applet_name = bb_basename(applet_name); |
1415 | 1427 | ||