]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* config/general.m4sh: New variable quote_scanset..
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 28 Dec 2004 12:40:10 +0000 (12:40 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 28 Dec 2004 12:40:10 +0000 (12:40 +0000)
(func_quote_for_eval, func_quote_for_expand)  ..use it to work around
SunOS ksh `case' backslash-escaping bug: protect character class by
variable expansion.  Reported by Alexander Kurz <alexander.kurz@qsc.de>.

ChangeLog
config/general.m4sh

index 1f28c99d67f598f7e1d3fe5256282ae18be95156..7d96480ac9ac922625514ff369f2574a96208e75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-12-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * config/general.m4sh: New variable quote_scanset..
+       (func_quote_for_eval, func_quote_for_expand)  ..use it to work around
+       SunOS ksh `case' backslash-escaping bug: protect character class by
+       variable expansion.  Reported by Alexander Kurz <alexander.kurz@qsc.de>.
+
        * tests/quote.test: Restart under the correct shell (the one
        $ECHO was computed for).
 
index 46ddbaa7b649e014a4480593fafbb696b603aef5..9fcb9faabb48e233f2209f452a8e15d051c44ef9 100644 (file)
@@ -95,6 +95,9 @@ sed_quote_subst='s/\([[`"$\\]]\)/\\\1/g'
 # Same as above, but do not quote variable references.
 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
 
+# Protect character class for func_quote_* by variable expansion.
+quote_scanset='[[@<:@~#^*{};<>?'"'"'   ]]'
+
 # Re-`\' parameter expansions in output of double_quote_subst that were
 # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
 # in input to double_quote_subst, that '$' was protected from expansion.
@@ -274,8 +277,11 @@ func_quote_for_eval ()
       # 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.
-      *[[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \        ]]*|*@:>@*|"")
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets
+      # at all, so we specify them separately.
+      *$quote_scanset* | *@:>@* | *\|* | *\&* | *\(* | *\)* | "")
         my_arg="\"$my_arg\""
         ;;
     esac
@@ -296,8 +302,11 @@ func_quote_for_expand ()
       # Double-quote args containing shell metacharacters to delay
       # word splitting and command substitution for a subsequent eval.
       # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \        ]]*|*@:>@*|"")
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets
+      # at all, so we specify them separately.
+      *$quote_scanset* | *@:>@* | *\|* | *\&* | *\(* | *\)* | "")
         my_arg="\"$my_arg\""
         ;;
     esac