diff options
author | Ron Yorston <rmy@pobox.com> | 2012-04-24 11:33:38 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-04-24 11:33:38 +0100 |
commit | 3d2d2184b0afc591f4ccf9e510b832b459251695 (patch) | |
tree | 37183a985a99da073dfa5a7e9b5a12ac46b3104a /shell | |
parent | 9f13ad33483464c76a36b9ac7b7a99e1c7709dcb (diff) | |
download | busybox-w32-3d2d2184b0afc591f4ccf9e510b832b459251695.tar.gz busybox-w32-3d2d2184b0afc591f4ccf9e510b832b459251695.tar.bz2 busybox-w32-3d2d2184b0afc591f4ccf9e510b832b459251695.zip |
ash: Only change slashes in environment on first invocation
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c index 3719066b9..8c39a504a 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13508,6 +13508,8 @@ init(void) | |||
13508 | * | 13508 | * |
13509 | * We may end up having both Path and PATH. Then Path will be chosen | 13509 | * We may end up having both Path and PATH. Then Path will be chosen |
13510 | * because it appears first. | 13510 | * because it appears first. |
13511 | * | ||
13512 | * Also, replace backslashes with forward slashes. | ||
13511 | */ | 13513 | */ |
13512 | for (envp = environ; envp && *envp; envp++) | 13514 | for (envp = environ; envp && *envp; envp++) |
13513 | if (!strncasecmp(*envp, "PATH=", 5) && | 13515 | if (!strncasecmp(*envp, "PATH=", 5) && |
@@ -13521,17 +13523,15 @@ init(void) | |||
13521 | continue; | 13523 | continue; |
13522 | for (start = *envp;start < end;start++) | 13524 | for (start = *envp;start < end;start++) |
13523 | *start = toupper(*start); | 13525 | *start = toupper(*start); |
13526 | for ( ++end; *end; ++end ) { | ||
13527 | if ( *end == '\\' ) { | ||
13528 | *end = '/'; | ||
13529 | } | ||
13530 | } | ||
13524 | } | 13531 | } |
13525 | } | 13532 | } |
13526 | #endif | 13533 | #endif |
13527 | for (envp = environ; envp && *envp; envp++) { | 13534 | for (envp = environ; envp && *envp; envp++) { |
13528 | #if ENABLE_PLATFORM_MINGW32 | ||
13529 | char *s; | ||
13530 | |||
13531 | while ((s=strchr(*envp, '\\'))) { | ||
13532 | *s = '/'; | ||
13533 | } | ||
13534 | #endif | ||
13535 | if (strchr(*envp, '=')) { | 13535 | if (strchr(*envp, '=')) { |
13536 | setvareq(*envp, VEXPORT|VTEXTFIXED); | 13536 | setvareq(*envp, VEXPORT|VTEXTFIXED); |
13537 | } | 13537 | } |