aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-13 00:34:26 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-13 00:34:26 +0200
commitb771c654cab511b172484479cafd006d52588103 (patch)
tree54a5cd2fb09061217441afb00053a6e9c2e00284 /shell/hush.c
parent99862cbfad9c36b4f8f4378c3a7a9f077c239f20 (diff)
downloadbusybox-w32-b771c654cab511b172484479cafd006d52588103.tar.gz
busybox-w32-b771c654cab511b172484479cafd006d52588103.tar.bz2
busybox-w32-b771c654cab511b172484479cafd006d52588103.zip
shell: shrink arith code; and prepare for returning text error codes
function old new delta arith 701 680 -21 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 752efd0c8..ef0c454ec 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
4728 if (beg < 0) /* bash compat */ 4728 if (beg < 0) /* bash compat */
4729 beg = 0; 4729 beg = 0;
4730 debug_printf_varexp("from val:'%s'\n", val); 4730 debug_printf_varexp("from val:'%s'\n", val);
4731 if (len == 0 || !val || beg >= strlen(val)) 4731 if (len == 0 || !val || beg >= strlen(val)) {
4732 val = ""; 4732 val = NULL;
4733 else { 4733 } else {
4734 /* Paranoia. What if user entered 9999999999999 4734 /* Paranoia. What if user entered 9999999999999
4735 * which fits in arith_t but not int? */ 4735 * which fits in arith_t but not int? */
4736 if (len >= INT_MAX) 4736 if (len >= INT_MAX)
@@ -4742,7 +4742,7 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha
4742#endif 4742#endif
4743 { 4743 {
4744 die_if_script("malformed ${%s:...}", var); 4744 die_if_script("malformed ${%s:...}", var);
4745 val = ""; 4745 val = NULL;
4746 } 4746 }
4747 } else { /* one of "-=+?" */ 4747 } else { /* one of "-=+?" */
4748 /* Standard-mandated substitution ops: 4748 /* Standard-mandated substitution ops: