]> git.ipfire.org Git - thirdparty/autoconf.git/commit
Fix bug with AS_IF and ‘set -e’
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Apr 2022 05:29:05 +0000 (22:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Apr 2022 05:38:38 +0000 (22:38 -0700)
commitc8d6d6eb8be36144f1285f35901e325b56bac68f
tree29df3162dcb7f6b5180566f41f39b266a983e009
parent00358457d09c19ff6b5ec7ed98708540d1994a5f
Fix bug with AS_IF and ‘set -e’

Problem reported by Peter Johansson in:
https://lists.gnu.org/r/bug-autoconf/2022-03/msg00009.html
The bug was introduced in 2020-11-15T18:56:18Z!zackw@panix.com
with commit message saying “If anyone has a better idea for how to
make this work I will be glad to hear it”, and this patch uses a
trick with ‘case’ that should be a better idea.
* lib/m4sugar/m4sh.m4 (as_nop, as_fn_nop, _AS_EMPTY_ELSE_PREPARE):
Remove.  All uses removed.
(_AS_IF_ELSE): Wrap the non-blank IF-ELSE inside a no-op case,
which works since a case branch can be empty in the shell.
* tests/m4sh.at (AS_IF and AS_CASE): Test the fix.
lib/m4sugar/m4sh.m4
tests/m4sh.at