From 2ca4d5561279cebf7c4bd5e5c15157ae5785ab08 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 24 Oct 2012 15:19:16 +0200 Subject: [PATCH] Improve Cygwin path-stripping code (fixes issue #67) Using awk to strip any Cygwin path creates a null-byte at the end of the string. This makes the last item in the path unresolvable and causes child processes that are not dependent on msys-1.0.dll to inherit POSIX rather than Windows paths. Fix this by not using awk at all. Reported-by: John Stevenson Signed-off-by: Sebastian Schuberth --- etc/profile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/etc/profile b/etc/profile index 1f3a001b..4439ed60 100644 --- a/etc/profile +++ b/etc/profile @@ -24,9 +24,7 @@ fi # strip out cygwin paths from PATH case "$PATH" in */cygwin/*) - PATH="$(awk -vRS=: -vORS=: '!/cygwin/' <<< "$PATH")" - # awk always adds a trailing separator - export PATH="${PATH%:}" + export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -vi "/cygwin/" | tr "\n" ":"); echo ${p%:}) ;; esac -- 2.11.4.GIT