From 3d2d2184b0afc591f4ccf9e510b832b459251695 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 24 Apr 2012 11:33:38 +0100 Subject: ash: Only change slashes in environment on first invocation --- shell/ash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'shell') 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) * * We may end up having both Path and PATH. Then Path will be chosen * because it appears first. + * + * Also, replace backslashes with forward slashes. */ for (envp = environ; envp && *envp; envp++) if (!strncasecmp(*envp, "PATH=", 5) && @@ -13521,17 +13523,15 @@ init(void) continue; for (start = *envp;start < end;start++) *start = toupper(*start); + for ( ++end; *end; ++end ) { + if ( *end == '\\' ) { + *end = '/'; + } + } } } #endif for (envp = environ; envp && *envp; envp++) { -#if ENABLE_PLATFORM_MINGW32 - char *s; - - while ((s=strchr(*envp, '\\'))) { - *s = '/'; - } -#endif if (strchr(*envp, '=')) { setvareq(*envp, VEXPORT|VTEXTFIXED); } -- cgit v1.2.3-55-g6feb