Skip to content

Commit

Permalink
Properly escape paths to executables. Fixes #18632.
Browse files Browse the repository at this point in the history
  • Loading branch information
vharavy committed Nov 5, 2014
1 parent 5c1fd5f commit bec2ee7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -101,7 +114,7 @@ probe() {
fi
done
eval $V=\$T
putvar $V "$VER"
putpathvar $V "$VER"
}

probe_need() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bec2ee7

Please sign in to comment.