aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-07-30 13:34:07 +0100
committerRon Yorston <rmy@pobox.com>2015-07-30 13:34:07 +0100
commit7aabb625005c642d6a30d6d97b51bf183429152e (patch)
treef5fabc075778d7f0a291cbbe6dd9374f7a1e4e8e
parente4927433de9601f4e34126f740915ffa4e2ec663 (diff)
downloadbusybox-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.
-rw-r--r--README.md2
-rw-r--r--shell/ash.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/README.md b/README.md
index 69c991ae9..d9988c45e 100644
--- a/README.md
+++ b/README.md
@@ -18,5 +18,5 @@ Then just `make`.
18 - Don't do wild things with Windows drive or UNC notation. 18 - Don't do wild things with Windows drive or UNC notation.
19 - Wildcard expansion is disabled by default, though it can be turned on at compile time. This only affects command line arguments to the binary: the BusyBox shell has full support for wildcards. 19 - Wildcard expansion is disabled by default, though it can be turned on at compile time. This only affects command line arguments to the binary: the BusyBox shell has full support for wildcards.
20 - Handling of users, groups and permissions is totally bogus. The system only admits to knowing about the current user and always returns the same hardcoded uid, gid and permission values. 20 - Handling of users, groups and permissions is totally bogus. The system only admits to knowing about the current user and always returns the same hardcoded uid, gid and permission values.
21 - Windows XP and Windows Server 2003 sometimes have trouble with forward slashes in environment variables. The -X shell option (which must be the first argument) prevents busybox-w32 from changing backslashes to forward slashes. 21 - Some crufty old Windows code (Windows XP, cmd.exe) doesn't like forward slashes in environment variables. The -X shell option (which must be the first argument) prevents busybox-w32 from changing backslashes to forward slashes. If Windows programs don't run from the shell it's worth trying it.
22 - Currently only 32-bit builds of BusyBox work. If you want to install 32-bit BusyBox in a system directory on a 64-bit version of Windows you should put it in `C:\Windows\SysWOW64`, not `C:\Windows\System32`. On 64-bit systems the latter is for 64-bit binaries. 22 - Currently only 32-bit builds of BusyBox work. If you want to install 32-bit BusyBox in a system directory on a 64-bit version of Windows you should put it in `C:\Windows\SysWOW64`, not `C:\Windows\System32`. On 64-bit systems the latter is for 64-bit binaries.
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 ) {