diff --git a/build-aux/funclib.sh b/build-aux/funclib.sh index f92f7162..49747365 100644 --- a/build-aux/funclib.sh +++ b/build-aux/funclib.sh @@ -917,6 +917,7 @@ func_quote_for_eval () { $debug_cmd + func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in @@ -925,8 +926,13 @@ func_quote_for_eval () *) _G_unquoted_arg=$1 ;; esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi - case $func_quote_for_eval_unquoted_result in + case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. @@ -940,9 +946,11 @@ func_quote_for_eval () ;; esac - test -n "$func_quote_for_eval_result" \ - && func_append func_quote_for_eval_result " " - func_append func_quote_for_eval_result "$_G_unquoted_arg" + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi shift done } diff --git a/build-aux/options-parser b/build-aux/options-parser index 64b990e4..bab50b42 100644 --- a/build-aux/options-parser +++ b/build-aux/options-parser @@ -173,7 +173,8 @@ func_run_hooks () # store returned options list back into positional # parameters for next `cmd' execution. - eval set dummy \$${_G_hook}_result; shift + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} @@ -315,7 +316,7 @@ func_parse_options () func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match - eval set dummy $func_run_hooks_result; shift + eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break