summaryrefslogtreecommitdiff
path: root/msvcc.sh
diff options
context:
space:
mode:
authorTres Finocchiaro <tres.finocchiaro@gmail.com>2020-11-24 19:13:57 -0500
committerGitHub <noreply@github.com>2020-11-24 19:13:57 -0500
commite70bf987daa7b7b5df2de7579d5c51a888e8bf7d (patch)
treee8ef7ae4fb144676e16160db5b598f17439fd792 /msvcc.sh
parent8cc8f446f5aac13e107161dffbc15d1ee1a58878 (diff)
downloadlibffi-e70bf987daa7b7b5df2de7579d5c51a888e8bf7d.tar.gz
Properly quote and resolve msvcc.sh params (#596)
Diffstat (limited to 'msvcc.sh')
-rwxr-xr-xmsvcc.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/msvcc.sh b/msvcc.sh
index 97facd6..7cfc509 100755
--- a/msvcc.sh
+++ b/msvcc.sh
@@ -165,24 +165,24 @@ do
shift 1
;;
-I)
- p=$(cygpath -m $2)
- args="$args -I$p"
- includes="$includes -I$p"
+ p=$(cygpath -ma "$2")
+ args="$args -I\"$p\""
+ includes="$includes -I\"$p\""
shift 2
;;
-I*)
- p=$(cygpath -m ${1#-I})
- args="$args -I$p"
- includes="$includes -I$p"
+ p=$(cygpath -ma "${1#-I}")
+ args="$args -I\"$p\""
+ includes="$includes -I\"$p\""
shift 1
;;
-L)
- p=$(cygpath -m $2)
+ p=$(cygpath -ma $2)
linkargs="$linkargs -LIBPATH:$p"
shift 2
;;
-L*)
- p=$(cygpath -m ${1#-L})
+ p=$(cygpath -ma ${1#-L})
linkargs="$linkargs -LIBPATH:$p"
shift 1
;;
@@ -256,12 +256,12 @@ do
shift 2
;;
*.S)
- src=$1
+ src="$(cygpath -ma $1)"
assembly="true"
shift 1
;;
*.c)
- args="$args $1"
+ args="$args $(cygpath -ma $1)"
shift 1
;;
*)
@@ -312,7 +312,7 @@ if [ -n "$assembly" ]; then
echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
fi
- "$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
+ eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $?
output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
if [ $ml = "armasm" ]; then
args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt"