]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix bugs in previous version of m4_bpatsubsts.
authorEric Blake <ebb9@byu.net>
Wed, 30 Jul 2008 15:45:21 +0000 (09:45 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 30 Jul 2008 15:45:21 +0000 (09:45 -0600)
* lib/m4sugar/foreach.m4 (_m4_bpatsubsts): Don't expand $1, and
allow concatenation with subsequent text.
* tests/m4sugar.at (m4@&t@_bpatsubsts): Enhance test.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/m4sugar/foreach.m4
tests/m4sugar.at

index 5f348b3458dfed347946c6fc5dd06096bee8a517..5ff6e000af0ee1a13542e6f009a0bb15f60e4c8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-30  Eric Blake  <ebb9@byu.net>
+
+       Fix bugs in previous version of m4_bpatsubsts.
+       * lib/m4sugar/foreach.m4 (_m4_bpatsubsts): Don't expand $1, and
+       allow concatenation with subsequent text.
+       * tests/m4sugar.at (m4@&t@_bpatsubsts): Enhance test.
+
 2008-07-29  Eric Blake  <ebb9@byu.net>
 
        Add linear m4_bpatsubsts for m4 1.4.x.
index 015e0beec0da2245f5edb7ca6edf48dd0ebbc271..3109a8f87a8fe3459c7226d09db5c9983b8ba782 100644 (file)
@@ -137,11 +137,11 @@ m4_define([_m4_case_],
 #   m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p],
 #   m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],...
 #   m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote(
-#   _m4_defn([_m4_p]))[]_m4_popdef([_m4_p])
+#   _m4_defn([_m4_p])_m4_popdef([_m4_p]))
 m4_define([_m4_bpatsubsts],
 [m4_define([_m4_p], m4_pushdef([_m4_p])[m4_define([_m4_p],
-  [$1])]_m4_for([_m4_p], [3], [$#], [2], [$0_(m4_decr(_m4_p),
-  _m4_p)])[m4_unquote(_m4_defn([_m4_p]))[]_m4_popdef([_m4_p])])_m4_p($@)])
+  ]m4_dquote([$]1)[)]_m4_for([_m4_p], [3], [$#], [2], [$0_(m4_decr(_m4_p),
+  _m4_p)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
 
 m4_define([_m4_bpatsubsts_],
 [[m4_define([_m4_p],
index a1c0bd0d4bca91a1ba0c729e1603006bcdbdb76a..516881e9f15d79d9305055e1362f1487a0cdf59b 100644 (file)
@@ -532,14 +532,19 @@ AT_CHECK_M4SUGAR_TEXT(
 m4_bpatsubsts([11], [\(.\)1], [\12])
 m4_bpatsubsts([11], [^..$], [], [1], [2])
 m4_bpatsubsts([11], [\(.\)1], [\12], [1], [3])
-m4_define([a], [oops])m4_define([AB], [good])dnl
+m4_define([a], [oops])m4_define([c], [oops])dnl
+m4_define([AB], [good])m4_define([bc], [good])dnl
 m4_bpatsubsts([abc], [a], [A], [b], [B], [c])
+m4_bpatsubsts([ab], [a])c
+m4_bpatsubsts([ab], [c], [C], [a])c
 m4_bpatsubsts([$1$*$@], [\$\*], [$#])
 ]], [[11
 21
 22
 23
 good
+good
+good
 $1$#$@
 ]])