From b67a10c4a167f28090b506ee3e27f33336633a10 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Mon, 11 May 2015 13:48:13 +0200 Subject: [PATCH] configure: don't fail when $CPPFLAGS starts with a white space --- configure | 6 +++--- configure.ac | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 8aa333d38..7c22d30d6 100755 --- a/configure +++ b/configure @@ -5801,15 +5801,15 @@ _ACEOF # Original extract() function contributed by pmzqla # $*: Strings to parse -# Set $DEFINES, $INCLUDES, $OTHER +# Set $QBT_CONF_DEFINES, $QBT_CONF_INCLUDES, $QBT_CONF_EXTRA_CFLAGS extract() { if [ -z "$*" ]; then echo "Input string required" return 1 fi - # Convert " -" to "\n" if not between quotes - string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g") + # Convert " -" to "\n" if not between quotes and remove possible leading white spaces + string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[:space:]*//') SAVEIFS=$IFS IFS=$(printf "\n\b") for i in $string; do diff --git a/configure.ac b/configure.ac index bd3a9e116..0c9075d92 100644 --- a/configure.ac +++ b/configure.ac @@ -251,15 +251,15 @@ AX_DEFINE_DIR([EXPAND_MANDIR], [mandir]) # Original extract() function contributed by pmzqla # $*: Strings to parse -# Set $DEFINES, $INCLUDES, $OTHER +# Set $QBT_CONF_DEFINES, $QBT_CONF_INCLUDES, $QBT_CONF_EXTRA_CFLAGS extract() { if [[ -z "$*" ]]; then echo "Input string required" return 1 fi - # Convert " -" to "\n" if not between quotes - string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g") + # Convert " -" to "\n" if not between quotes and remove possible leading white spaces + string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//') SAVEIFS=$IFS IFS=$(printf "\n\b") for i in $string; do