Use posix shell variable expansion substitution instead of subshells with sed

This commit is contained in:
Martin Storsjö committed 2018-10-08 14:13:42 +03:00
1 parent 0ec597b1bb
commit 818766d3d4
5 files changed
+18 -13

No files matched your search

+4 -3
View File
@@ -86,8 +86,9 @@ INPUT_FORMAT=rc
OUTPUT_FORMAT=coff
CODEPAGE=1252
CPP_OPTIONS=
TARGET="$(basename $0 | sed 's/-[^-]*$//')"
PROG="$(basename $0)"
BASENAME="$(basename "$0")"
TARGET="${BASENAME%-*}"
PROG="$BASENAME"
while [ $# != 0 ]; do
case "$1" in
@@ -155,7 +156,7 @@ while [ $# != 0 ]; do
shift
done
ARCH=$(echo $TARGET | sed 's/-.*//')
ARCH="${TARGET%%-*}"
case $ARCH in
i686) M=X86 ;;
x86_64) M=X64 ;;