From 26777aa1c659b229f07205291241e45e64712a72 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 22 Nov 2010 23:49:10 +0100 Subject: fixes for bugs discovered by randomconfig builds and tests Signed-off-by: Denys Vlasenko --- shell/ash.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'shell/ash.c') diff --git a/shell/ash.c b/shell/ash.c index 5ef7efbdb..5671a524b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -43,7 +43,9 @@ #include #include "shell_common.h" -#include "math.h" +#if ENABLE_SH_MATH_SUPPORT +# include "math.h" +#endif #if ENABLE_ASH_RANDOM_SUPPORT # include "random.h" #else @@ -5510,6 +5512,11 @@ static struct arglist exparg; /* * Our own itoa(). */ +#if !ENABLE_SH_MATH_SUPPORT +/* cvtnum() is used even if math support is off (to prepare $? values and such) */ +typedef long arith_t; +# define ARITH_FMT "%ld" +#endif static int cvtnum(arith_t num) { -- cgit v1.2.3