]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix exit status of expr version of as_func_arith.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 16 Nov 2008 21:18:07 +0000 (22:18 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 16 Nov 2008 21:18:07 +0000 (22:18 +0100)
* 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 <Ralf.Wildenhues@gmx.de>
ChangeLog
lib/m4sugar/m4sh.m4

index ec89991bfe9838de462a9218b8a36645269116c0..7a8502d8e38c81c7b7f330a23ca3ff2fe83edc58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       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.
index f106e2db55a65d706f23038752209ee60f9e9030..56697ad5c3f09c4d1c4aa04fc72d4f0a7c357397 100644 (file)
@@ -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
 ])