diff options
author | Ron Yorston <rmy@pobox.com> | 2015-07-30 13:34:07 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-07-30 13:34:07 +0100 |
commit | 7aabb625005c642d6a30d6d97b51bf183429152e (patch) | |
tree | f5fabc075778d7f0a291cbbe6dd9374f7a1e4e8e /shell | |
parent | e4927433de9601f4e34126f740915ffa4e2ec663 (diff) | |
download | busybox-w32-7aabb625005c642d6a30d6d97b51bf183429152e.tar.gz busybox-w32-7aabb625005c642d6a30d6d97b51bf183429152e.tar.bz2 busybox-w32-7aabb625005c642d6a30d6d97b51bf183429152e.zip |
ash: don't convert path delimiters for certain environment variables
The SYSTEMROOT and COMSPEC environment variables are known to
cause problems for Windows applications if they contain forward
slashes rather than backslashes. So don't convert them, even
if the -X flag isn't present.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index ef3f7933a..349e9deb8 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13475,6 +13475,12 @@ init(void) | |||
13475 | for (start = *envp;start < end;start++) | 13475 | for (start = *envp;start < end;start++) |
13476 | *start = toupper(*start); | 13476 | *start = toupper(*start); |
13477 | 13477 | ||
13478 | /* skip conversion of variables known to cause problems */ | ||
13479 | if ( strncmp(*envp, "SYSTEMROOT=", 11) == 0 || | ||
13480 | strncmp(*envp, "COMSPEC=", 8) == 0 ) { | ||
13481 | continue; | ||
13482 | } | ||
13483 | |||
13478 | /* convert backslashes to forward slashes */ | 13484 | /* convert backslashes to forward slashes */ |
13479 | if (!xp) { | 13485 | if (!xp) { |
13480 | for ( ++end; *end; ++end ) { | 13486 | for ( ++end; *end; ++end ) { |