From: Ralf Wildenhues Date: Tue, 30 Nov 2004 20:46:23 +0000 (+0000) Subject: * config/general.m4sh: basename sed-subst is anchored and thus X-Git-Tag: release-2-1b~830 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b430e15d24b4450454f9b39a217988f77b7d448a;p=thirdparty%2Flibtool.git * config/general.m4sh: basename sed-subst is anchored and thus does not need the `g' flag. (func_quote_for_eval): Return both the possibly double-quoted backslashified as well as only the backslashified argument. * config/ltmain.m4sh (func_mode_link): Use both return values, to save another sed_quote_subst application per cmdline arg. --- diff --git a/ChangeLog b/ChangeLog index fe34e3b4b..603243862 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-11-30 Ralf Wildenhues + + * config/general.m4sh: basename sed-subst is anchored and thus + does not need the `g' flag. + (func_quote_for_eval): Return both the possibly double-quoted + backslashified as well as only the backslashified argument. + * config/ltmain.m4sh (func_mode_link): Use both return values, + to save another sed_quote_subst application per cmdline arg. + 2004-11-29 Ralf Wildenhues * config/ltmain.m4sh (func_lalib_p): Update function diff --git a/config/general.m4sh b/config/general.m4sh index 46ddbaa7b..0b4b2151a 100644 --- a/config/general.m4sh +++ b/config/general.m4sh @@ -52,7 +52,7 @@ exit_status=$EXIT_SUCCESS "} dirname="s,/[[^/]]*$,," -basename="s,^.*/,,g" +basename="s,^.*/,," # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of @@ -265,22 +265,26 @@ func_mktempdir () # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. func_quote_for_eval () { - my_arg=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` - case $my_arg in + case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]]*|*@:>@*|"") - my_arg="\"$my_arg\"" + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac - - func_quote_for_eval_result="$my_arg" } diff --git a/config/ltmain.m4sh b/config/ltmain.m4sh index b71e6c62e..62b0e0970 100644 --- a/config/ltmain.m4sh +++ b/config/ltmain.m4sh @@ -2226,8 +2226,8 @@ func_mode_link () while test "$#" -gt 0; do arg="$1" shift - qarg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"` func_quote_for_eval "$arg" + qarg="$func_quote_for_eval_unquoted_result" libtool_args="$libtool_args $func_quote_for_eval_result" # If the previous option needs an argument, assign it.