Skip to content

Commit bec2ee7

Browse files
committed
Properly escape paths to executables. Fixes #18632.
1 parent 5c1fd5f commit bec2ee7

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

configure

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ putvar() {
7676
printf "%-20s := %s\n" $1 "$T" >>config.tmp
7777
}
7878

79+
putpathvar() {
80+
local T
81+
eval T=\$$1
82+
eval TLEN=\${#$1}
83+
if [ $TLEN -gt 35 ]
84+
then
85+
printf "configure: %-20s := %.35s ...\n" $1 "$T"
86+
else
87+
printf "configure: %-20s := %s %s\n" $1 "$T" "$2"
88+
fi
89+
printf "%-20s := %q\n" $1 "$T" >>config.tmp
90+
}
91+
7992
probe() {
8093
local V=$1
8194
shift
@@ -101,7 +114,7 @@ probe() {
101114
fi
102115
done
103116
eval $V=\$T
104-
putvar $V "$VER"
117+
putpathvar $V "$VER"
105118
}
106119

107120
probe_need() {
@@ -1330,8 +1343,7 @@ do
13301343
done
13311344

13321345
# Munge any paths that appear in config.mk back to posix-y
1333-
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \
1334-
-e 's@\\@/@go;' config.tmp
1346+
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' config.tmp
13351347
rm -f config.tmp.bak
13361348

13371349
msg

0 commit comments

Comments
 (0)