From 7aabb625005c642d6a30d6d97b51bf183429152e Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 30 Jul 2015 13:34:07 +0100 Subject: 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. --- shell/ash.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'shell') 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) for (start = *envp;start < end;start++) *start = toupper(*start); + /* skip conversion of variables known to cause problems */ + if ( strncmp(*envp, "SYSTEMROOT=", 11) == 0 || + strncmp(*envp, "COMSPEC=", 8) == 0 ) { + continue; + } + /* convert backslashes to forward slashes */ if (!xp) { for ( ++end; *end; ++end ) { -- cgit v1.2.3-55-g6feb