Changeset 14701


Ignore:
Timestamp:
Mar 2, 2016, 4:31:16 PM (13 months ago)
Author:
mikedld
Message:

#6079: Fix miniupnpc script to handle spaces and other special chars in paths

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/third-party/miniupnp/updateminiupnpcstrings.sh

    r14571 r14701  
    44# (c) 2009 Thomas Bernard
    55
    6 VERSION_FILE=$1
    7 TEMPLATE_FILE=$2
    8 FILE=$3
    9 TMPFILE=$3.tmp
     6VERSION_FILE="$1"
     7TEMPLATE_FILE="$2"
     8FILE="$3"
     9TMPFILE="$3.tmp"
    1010
    1111# detecting the OS name and version
     
    3939
    4040echo "Detected OS [$OS_NAME] version [$OS_VERSION]"
    41 MINIUPNPC_VERSION=`cat ${VERSION_FILE}`
     41MINIUPNPC_VERSION=`cat "${VERSION_FILE}"`
    4242echo "MiniUPnPc version [${MINIUPNPC_VERSION}]"
    4343
    4444EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|"
    4545#echo $EXPR
    46 test -f ${FILE}.in
     46test -f "${FILE}.in"
    4747echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE."
    48 sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE
     48sed -e "$EXPR" < "$TEMPLATE_FILE" > "$TMPFILE"
    4949
    5050EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|"
    5151echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE."
    52 sed -e "$EXPR" < $TMPFILE > $FILE
    53 rm $TMPFILE
     52sed -e "$EXPR" < "$TMPFILE" > "$FILE"
     53rm "$TMPFILE"
    5454
Note: See TracChangeset for help on using the changeset viewer.