{
$debug_cmd
+ func_quote_for_eval_unquoted_result=
func_quote_for_eval_result=
while test 0 -lt $#; do
case $1 in
*)
_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.
;;
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
}
# 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+"$@"}
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