From: Eric Blake Date: Wed, 15 Apr 2009 01:06:27 +0000 (-0600) Subject: Fix yesterday's regression in AS_IF. X-Git-Tag: v2.64~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc796433831e23df45f75c9e34e50860e44da90f;p=thirdparty%2Fautoconf.git Fix yesterday's regression in AS_IF. * lib/m4sugar/m4sh.m4 (_AS_IF_ELSE): Don't corrupt $? in else branch; it is up to the user to avoid syntax errors. * tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Adjust test. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 68cd41663..feaabe6f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-14 Eric Blake + + Fix yesterday's regression in AS_IF. + * lib/m4sugar/m4sh.m4 (_AS_IF_ELSE): Don't corrupt $? in else + branch; it is up to the user to avoid syntax errors. + * tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Adjust test. + 2009-04-14 Ralf Wildenhues Add traces for AM_SILENT_RULES. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 052c7eb10..3c05201ae 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -609,7 +609,7 @@ m4_define([_AS_IF], ]) m4_define([_AS_IF_ELSE], [m4_ifnblank([$1], -[else : +[else $1 ])]) diff --git a/tests/m4sh.at b/tests/m4sh.at index 5f7dc847b..065a9dda8 100644 --- a/tests/m4sh.at +++ b/tests/m4sh.at @@ -862,8 +862,11 @@ AS_CASE([foo], [foo], m4_do(AS_CASE([bar], [bar], [echo sixteen]))) dnl Handle blank arguments. AS_IF([false], [:], [ ]) && AS_CASE([foo], [foo], [] ) && echo seventeen -m4_define([empty])AS_IF([false], [:], [empty] +m4_define([empty])AS_IF([:], [empty] ) && AS_CASE([foo], [foo], [empty]) && echo eighteen +dnl We can't handle AS_IF([false], [:], [empty]) unless m4_expand is +dnl taught how to handle m4_require. The user is responsible for +dnl avoiding the syntax error in that case. # check that require works correctly m4_for([n], 1, 9, [],