autoconf-patches
[Top][All Lists]
Advanced

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

m4_bmatch expansion bug


From: Andreas Schwab
Subject: m4_bmatch expansion bug
Date: Tue, 02 Apr 2002 19:36:41 +0200
User-agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2.50 (ia64-suse-linux)

m4_bmatch can generate a spurious error message.  The problem is that
m4_bregexp is expanded even if $# <= 2, so that it may complain about an
invalid regexp in $2 even though the expansion is not used.

m4_bmatch([asdf], [[]])
error--> Bad regular expression `[]': Unmatched [ or [^

Andreas.

2002-04-02  Andreas Schwab  <address@hidden>

        * lib/m4sugar/m4sugar.m4 (m4_bmatch): Make sure m4_bregexp is not
        expanded if $# <= 2.

--- lib/m4sugar/m4sugar.m4.~2.63.~      2002-03-30 21:33:00.000000000 +0100
+++ lib/m4sugar/m4sugar.m4      2002-04-02 18:18:46.000000000 +0200
@@ -422,8 +422,8 @@
 [m4_if([$#], 0, [],
        [$#], 1, [],
        [$#], 2, [$2],
-       m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shiftn(3, $@))],
-       [$3])])
+       [m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shiftn(3, $@))],
+             [$3])])])
 
 
 # m4_map(MACRO, LIST)

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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