]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AS_LITERAL_IF: Treat raw = as literal again.
authorEric Blake <eblake@redhat.com>
Fri, 8 Oct 2010 16:54:31 +0000 (10:54 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 8 Oct 2010 17:52:16 +0000 (11:52 -0600)
* lib/m4sugar/m4sh.m4 (_AS_LITERAL_IF): Treat = like +.
* tests/m4sh.at (AS@&t@_TR_SH and AS@&t@_TR_CPP)
(AS@&t@_LITERAL_IF): Expand tests.
* NEWS: Document the fix.
Reported via Ben Pfaff; originally http://bugs.debian.org/593838

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
NEWS
lib/m4sugar/m4sh.m4
tests/m4sh.at

index 576f6151358f986254002ea53775487cf2d9748a..609846afd4f2fc4807fdef38d8be1b1196baad05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-10-08  Eric Blake  <eblake@redhat.com>
+
+       AS_LITERAL_IF: Treat raw = as literal again.
+       * lib/m4sugar/m4sh.m4 (_AS_LITERAL_IF): Treat = like +.
+       * tests/m4sh.at (AS@&t@_TR_SH and AS@&t@_TR_CPP)
+       (AS@&t@_LITERAL_IF): Expand tests.
+       * NEWS: Document the fix.
+       Reported via Ben Pfaff; originally http://bugs.debian.org/593838
+
 2010-09-24  Joshua G. Hale  <jgh.emc@gmail.com>  (tiny change)
 
        docs: fix typo in AC_CONFIG_FILES example code.
diff --git a/NEWS b/NEWS
index a3a50d67bcd71cd23555f236bb87a0ba9df19aa8..6b6254241028d48692b08b0f6a2e6de849e60708 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ GNU Autoconf NEWS - User visible changes.
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** AS_LITERAL_IF again treats '=' as a literal.  Regression introduced in
+   2.66.
+
 
 * Noteworthy changes in release 2.68 (2010-09-22) [stable]
   Released by Eric Blake, based on git versions 2.67.*.
index 13ad849238506db23184419178bd3f753124b994..3c9350ac88516365132778c13baf846260c92f8b 100644 (file)
@@ -1584,8 +1584,8 @@ m4_define([AS_LITERAL_IF],
 
 m4_define([_AS_LITERAL_IF],
 [m4_if(m4_index([$1], [@S|@]), [-1], [$0_(m4_translit([$1],
-  [-:%/@{}[]#(),.$2]]]m4_dquote(m4_dquote(m4_defn([m4_cr_symbols2])))[[,
-  [+++++$$`````]))], [$0_NO])])
+  [-:=%/@{}[]#(),.$2]]]m4_dquote(m4_dquote(m4_defn([m4_cr_symbols2])))[[,
+  [++++++$$`````]))], [$0_NO])])
 
 m4_define([_AS_LITERAL_IF_],
 [m4_if(m4_translit([$1], [+]), [], [$0YES],
index 08680c30e779fbefeca89a2e3afb4e2aa5659ce1..c01027f694325ce6bbc1347513cf5f4ebb327e96 100644 (file)
@@ -1278,6 +1278,10 @@ echo AS_LITERAL_HEREDOC_IF([(a)], [ok], [ERR]) 20
 echo AS_LITERAL_IF([@S|@a], [ERR], [ok]) 21
 echo AS_LITERAL_WORD_IF([@S|@a], [ERR], [ok]) 22
 echo AS_LITERAL_HEREDOC_IF([@S|@a], [ERR], [ok]) 23
+echo AS_LITERAL_IF([${a+b}], [ERR1], [ok], [ERR2]) 24
+echo AS_LITERAL_IF([${a=b}], [ERR1], [ok], [ERR2]) 25
+echo AS_LITERAL_IF([a+b], [ok], [ERR1], [ERR2]) 26
+echo AS_LITERAL_IF([a=b], [ok], [ERR1], [ERR2]) 27
 ]])
 
 AT_CHECK_M4SH
@@ -1305,6 +1309,10 @@ ok 20
 ok 21
 ok 22
 ok 23
+ok 24
+ok 25
+ok 26
+ok 27
 ]])
 
 AT_CLEANUP
@@ -1342,12 +1350,13 @@ echo AS_TR_CPP(`echo abc`) AS_TR_CPP(`echo aBc`) AS_TR_CPP(`echo ABC`)
 echo AS_TR_CPP([`echo abc`]) AS_TR_CPP([`echo aBc`]) AS_TR_CPP([`echo ABC`])
 echo AS_TR_CPP([[`echo abc`]]) AS_TR_CPP([[`echo aBc`]]) AS_TR_CPP([[`echo ABC`]])
 echo ===
-echo AS_TR_SH([a.b/c+*-])
-echo AS_TR_CPP([a.b/c+*-])
-var=a.b/c+*-
+# start here
+echo AS_TR_SH([a.b/c+*-=])
+echo AS_TR_CPP([a.b/c+*-=])
+var=a.b/c+*-=
 echo AS_TR_SH([$var])
 echo AS_TR_CPP([$var])
-m4_define([macro], [a.b/c+*-])
+m4_define([macro], [a.b/c+*-=])
 echo AS_TR_SH([macro])
 echo AS_TR_CPP([macro])
 ]])
@@ -1375,12 +1384,19 @@ HI ABC HI
 HI ABC HI
 ABC ABC ABC
 ===
-a_b_cpp_
-A_B_C_P_
-a_b_cpp_
-A_B_C_P_
-a_b_cpp_
-A_B_C_P_
+a_b_cpp__
+A_B_C_P__
+a_b_cpp__
+A_B_C_P__
+a_b_cpp__
+A_B_C_P__
+]])
+
+dnl Check that of the last 6 macros, only 2 needed command substitution.
+dnl This test abuses our knowledge of m4sh internals a bit; oh well.
+AT_CHECK([sed -n '/start here/,$ {
+/`.*`/p
+}' script | wc -l], [], [[2
 ]])
 
 AT_CLEANUP