From: Ralf Wildenhues Date: Sun, 16 Nov 2008 21:18:07 +0000 (+0100) Subject: Fix exit status of expr version of as_func_arith. X-Git-Tag: v2.63b~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=291d709efde90f2a548233dc2d64296bc158f43d;p=thirdparty%2Fautoconf.git Fix exit status of expr version of as_func_arith. * lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE): Count an exit status of 1 of expr also as success, to avoid failure if the computation result is zero. Fixes test failures with IRIX sh, where the expr variant of as_func_arith is used. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index ec89991bf..7a8502d8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-11-16 Ralf Wildenhues + Fix exit status of expr version of as_func_arith. + * lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE): Count an exit + status of 1 of expr also as success, to avoid failure if the + computation result is zero. Fixes test failures with IRIX sh, + where the expr variant of as_func_arith is used. + Do not use read-only variable $status. * tests/compile.at (AC_RUN_IFELSE): Use $estatus instead of $status, for zsh. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index f106e2db5..56697ad5c 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -1743,6 +1743,7 @@ AS_IF([_AS_RUN(["AS_ESCAPE(m4_quote(_AS_VAR_ARITH_WORKS))"])], [as_func_arith () { as_val=`expr "$[]@"` + case $? in 0|1) :;; *) false;; esac }]) # as_func_arith ])