From: Eric Blake Date: Fri, 8 Oct 2010 16:54:31 +0000 (-0600) Subject: AS_LITERAL_IF: Treat raw = as literal again. X-Git-Tag: v2.68b~139 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b0d95faef68d7ed7c08b0edb9ff1c38728376fa;p=thirdparty%2Fautoconf.git 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 Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 576f61513..609846afd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-10-08 Eric Blake + + 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 (tiny change) docs: fix typo in AC_CONFIG_FILES example code. diff --git a/NEWS b/NEWS index a3a50d67b..6b6254241 100644 --- 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.*. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 13ad84923..3c9350ac8 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -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], diff --git a/tests/m4sh.at b/tests/m4sh.at index 08680c30e..c01027f69 100644 --- a/tests/m4sh.at +++ b/tests/m4sh.at @@ -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