From: Michael Wallner Date: Thu, 8 Oct 2015 09:16:22 +0000 (+0200) Subject: fix generating config.nice; again X-Git-Tag: php-7.2.0alpha1~620^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e856232d864721b22fb5dfa223361424634a178;p=php fix generating config.nice; again The fix in a8bc18420702e1b4fa524d21eae804cd6004879e broke if an arg containing spaces was passed to configure. --- diff --git a/acinclude.m4 b/acinclude.m4 index e828de1fd6..70b1a79894 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2685,20 +2685,21 @@ EOF else CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0" fi - for arg in $ac_configure_args; do - if test `expr -- $arg : "'.*"` = 0; then - if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then - continue; - fi - echo "'[$]arg' \\" >> $1 - CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'" - else - if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then - continue; - fi - echo "[$]arg \\" >> $1 - CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg" - fi + CONFIGURE_ARGS="$ac_configure_args" + while test "X$CONFIGURE_ARGS" != "X"; + do + if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"` + then + CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"` + elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"` + then + CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"` + CURRENT_ARG="'$CURRENT_ARG'" + else + break + fi + $as_echo "$CURRENT_ARG \\" >>$1 + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG" done echo '"[$]@"' >> $1 chmod +x $1