From b771c654cab511b172484479cafd006d52588103 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 13 Sep 2010 00:34:26 +0200 Subject: shell: shrink arith code; and prepare for returning text error codes function old new delta arith 701 680 -21 Signed-off-by: Denys Vlasenko --- shell/hush.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'shell/hush.c') diff --git a/shell/hush.c b/shell/hush.c index 752efd0..ef0c454 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -4728,9 +4728,9 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha if (beg < 0) /* bash compat */ beg = 0; debug_printf_varexp("from val:'%s'\n", val); - if (len == 0 || !val || beg >= strlen(val)) - val = ""; - else { + if (len == 0 || !val || beg >= strlen(val)) { + val = NULL; + } else { /* Paranoia. What if user entered 9999999999999 * which fits in arith_t but not int? */ if (len >= INT_MAX) @@ -4742,7 +4742,7 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha #endif { die_if_script("malformed ${%s:...}", var); - val = ""; + val = NULL; } } else { /* one of "-=+?" */ /* Standard-mandated substitution ops: -- cgit v1.1