From 61f82cb6b5172cb14c5aeb6473129f7915023316 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Wed, 2 Mar 2016 16:31:16 +0000 Subject: [PATCH] #6079: Fix miniupnpc script to handle spaces and other special chars in paths --- third-party/miniupnp/updateminiupnpcstrings.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/third-party/miniupnp/updateminiupnpcstrings.sh b/third-party/miniupnp/updateminiupnpcstrings.sh index dc075e314..0639da6a7 100755 --- a/third-party/miniupnp/updateminiupnpcstrings.sh +++ b/third-party/miniupnp/updateminiupnpcstrings.sh @@ -3,10 +3,10 @@ # project miniupnp : http://miniupnp.free.fr/ # (c) 2009 Thomas Bernard -VERSION_FILE=$1 -TEMPLATE_FILE=$2 -FILE=$3 -TMPFILE=$3.tmp +VERSION_FILE="$1" +TEMPLATE_FILE="$2" +FILE="$3" +TMPFILE="$3.tmp" # detecting the OS name and version OS_NAME=`uname -s` @@ -38,17 +38,17 @@ if [ "$OS_NAME" = "AmigaOS" ]; then fi echo "Detected OS [$OS_NAME] version [$OS_VERSION]" -MINIUPNPC_VERSION=`cat ${VERSION_FILE}` +MINIUPNPC_VERSION=`cat "${VERSION_FILE}"` echo "MiniUPnPc version [${MINIUPNPC_VERSION}]" EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|" #echo $EXPR -test -f ${FILE}.in +test -f "${FILE}.in" echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE." -sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE +sed -e "$EXPR" < "$TEMPLATE_FILE" > "$TMPFILE" EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|" echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE." -sed -e "$EXPR" < $TMPFILE > $FILE -rm $TMPFILE +sed -e "$EXPR" < "$TMPFILE" > "$FILE" +rm "$TMPFILE"