From: Sebastian Schuberth Date: Sat, 27 Oct 2012 20:36:50 +0000 (+0200) Subject: Revert "Improve Cygwin path-stripping code" X-Git-Url: https://repo.or.cz/w/msysgit.git/commitdiff_plain/3e7fb81e7257df9e4ab87b1e216f535d304d8991 Revert "Improve Cygwin path-stripping code" This reverts commit eb648717f20ad28d54ae0d3795346980a9f039f4 as it replaces spaces in paths in PATH with colons. Signed-off-by: Sebastian Schuberth --- diff --git a/etc/profile b/etc/profile index 4d48194f..1f3a001b 100644 --- a/etc/profile +++ b/etc/profile @@ -24,8 +24,10 @@ fi # strip out cygwin paths from PATH case "$PATH" in */cygwin/*) - export PATH=$(IFS=':'; t=($PATH); unset IFS; t=(${t[@]%%*/cygwin/*}); IFS=':'; echo "${t[*]}") - ;; + PATH="$(awk -vRS=: -vORS=: '!/cygwin/' <<< "$PATH")" + # awk always adds a trailing separator + export PATH="${PATH%:}" + ;; esac if [ -z "$USERNAME" ]; then