+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.
* 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.*.
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],
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
ok 21
ok 22
ok 23
+ok 24
+ok 25
+ok 26
+ok 27
]])
AT_CLEANUP
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])
]])
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