]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* config/general.m4sh: basename sed-subst is anchored and thus
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 30 Nov 2004 20:46:23 +0000 (20:46 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 30 Nov 2004 20:46:23 +0000 (20:46 +0000)
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.

ChangeLog
config/general.m4sh
config/ltmain.m4sh

index fe34e3b4b693dd268598cdc2028d4a15e617c774..6032438622fbddc8c9e8c323d00b07258a7fa425 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-11-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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  <Ralf.Wildenhues@gmx.de>
 
        * config/ltmain.m4sh (func_lalib_p): Update function
index 46ddbaa7b649e014a4480593fafbb696b603aef5..0b4b2151a92fb1324f8daebaf1788976c6392a43 100644 (file)
@@ -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"
 }
 
 
index b71e6c62ef4b132daf868f317c1f3fd12a396c26..62b0e097025e99a8545e9e041068b78b5d57a6d6 100644 (file)
@@ -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.