about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVitali Haravy <HumaneProgrammer@gmail.com>2014-11-05 23:33:18 +0000
committerVitali Haravy <HumaneProgrammer@gmail.com>2014-11-05 23:33:18 +0000
commitbec2ee77f78b4bb8a503101091272a634a273a1c (patch)
tree14fae27410198d3ea0e60e65869af39c2230e9ae
parent5c1fd5f8b7351085765217b198c6d5a8c0026b74 (diff)
downloadrust-bec2ee77f78b4bb8a503101091272a634a273a1c.tar.gz
rust-bec2ee77f78b4bb8a503101091272a634a273a1c.zip
Properly escape paths to executables. Fixes #18632.
-rwxr-xr-xconfigure18
1 files changed, 15 insertions, 3 deletions
diff --git a/configure b/configure
index 9eccc2f6e40..b63aeda9762 100755
--- a/configure
+++ b/configure
@@ -76,6 +76,19 @@ putvar() {
     printf "%-20s := %s\n" $1 "$T" >>config.tmp
 }
 
+putpathvar() {
+    local T
+    eval T=\$$1
+    eval TLEN=\${#$1}
+    if [ $TLEN -gt 35 ]
+    then
+        printf "configure: %-20s := %.35s ...\n" $1 "$T"
+    else
+        printf "configure: %-20s := %s %s\n" $1 "$T" "$2"
+    fi
+    printf "%-20s := %q\n" $1 "$T" >>config.tmp
+}
+
 probe() {
     local V=$1
     shift
@@ -101,7 +114,7 @@ probe() {
         fi
     done
     eval $V=\$T
-    putvar $V "$VER"
+    putpathvar $V "$VER"
 }
 
 probe_need() {
@@ -1330,8 +1343,7 @@ do
 done
 
 # Munge any paths that appear in config.mk back to posix-y
-perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \
-               -e 's@\\@/@go;' config.tmp
+perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' config.tmp
 rm -f config.tmp.bak
 
 msg