libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool-1.5.x quote.test fails with solaris /bin/ksh


From: Ralf Wildenhues
Subject: Re: libtool-1.5.x quote.test fails with solaris /bin/ksh
Date: Tue, 28 Dec 2004 13:40:55 +0100
User-agent: Mutt/1.4.1i

* Ralf Wildenhues wrote on Sat, Dec 18, 2004 at 09:20:39PM CET:
> * Ralf Wildenhues wrote on Mon, Dec 13, 2004 at 09:14:07AM CET:
> > * Alexander Kurz wrote on Thu, Dec 09, 2004 at 07:55:38PM CET:
> > > Obviously libtool has quoting-problems with solaris ksh.
> *snip*
> > > * the two testing-Platforms:
> > > SunOS xxxxxxxx 5.6 Generic_105181-29 sun4u sparc SUNW,Ultra-5_10
> > > strings /bin/ksh  | grep Ver # returns: @(#)Version M-11/16/88i
> > 
> *snip*
> > > SunOS xxxxxxxx 5.7 Generic_106541-18 sun4u sparc SUNW,Ultra-4
> > > strings /bin/ksh | grep Ver # returns @(#)Version M-11/16/88i
*snip*
> 
> Alrighty folks, after a lot of testing (many thanks to Alexander for his
> patience with me), we've analyzed the behavior of above Korn shells:
*snip*
> 
> The patch attached fixes libtool branch-1-5 to work around the issue.
> OK to apply?  (will forward-port)

Applied to branch-1-5, and similarly to branch-2-0 and HEAD (below is
the patch for branch-2-0).

Regards,
Ralf

 2004-12-28  Ralf Wildenhues  <address@hidden>
 
        * 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 <address@hidden>.
 
Index: config/general.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/general.m4sh,v
retrieving revision 1.2.2.8
diff -u -r1.2.2.8 general.m4sh
--- config/general.m4sh 24 Nov 2004 14:39:00 -0000      1.2.2.8
+++ config/general.m4sh 28 Dec 2004 12:24:23 -0000
@@ -95,6 +95,9 @@
 # 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 @@
       # 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 @@
       # 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]