summaryrefslogtreecommitdiff
path: root/m4/cond-if.m4
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2010-07-27 21:20:04 +0200
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>2010-07-27 21:31:33 +0200
commit1f92ad1d0a8d323a94c0abf5ad28fa2f31e9cd50 (patch)
tree1be3eaaaa8a4a702e460018ef6511e70bf7e677c /m4/cond-if.m4
parentc1361d43385ef7dd165683eb5fb1f7f9bb8778be (diff)
downloadautomake-1f92ad1d0a8d323a94c0abf5ad28fa2f31e9cd50.tar.gz
Avoid syntax error if IF-TRUE part of AM_COND_IF expands empty.
* m4/cond-if.m4 (AM_COND_IF): Ensure IF-TRUE part is never empty to avoid shell syntax error if the m4 expansion is empty. * tests/cond40.test: Enhance test. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'm4/cond-if.m4')
-rw-r--r--m4/cond-if.m48
1 files changed, 4 insertions, 4 deletions
diff --git a/m4/cond-if.m4 b/m4/cond-if.m4
index 9f2611ecb..250042247 100644
--- a/m4/cond-if.m4
+++ b/m4/cond-if.m4
@@ -1,12 +1,12 @@
# AM_COND_IF -*- Autoconf -*-
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
+# serial 2
# _AM_COND_IF
# _AM_COND_ELSE
@@ -27,8 +27,8 @@ AC_DEFUN([AM_COND_IF],
[m4_ifndef([_AM_COND_VALUE_$1],
[m4_fatal([$0: no such condition "$1"])])dnl
_AM_COND_IF([$1])dnl
-if _AM_COND_VALUE_$1; then
- m4_default([$2], [:])
+if _AM_COND_VALUE_$1; then :
+ m4_n([$2])[]dnl
m4_ifval([$3],
[_AM_COND_ELSE([$1])dnl
else