From: Denys Vlasenko Date: Mon, 17 Jul 2017 14:50:20 +0000 (+0200) Subject: hush: small fix to last commit X-Git-Tag: 1_28_0~377 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0ba80e4fa251a1c753e5feaff4b358a427aa58cb;p=oweals%2Fbusybox.git hush: small fix to last commit die_if_script() indeed dies only in scripts! Must handle the case where it continues. Signed-off-by: Denys Vlasenko --- diff --git a/shell/hush.c b/shell/hush.c index 836f3b83c..c8356f4b8 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -5736,7 +5736,7 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha if (len < 0) /* bash compat */ die_if_script("%s: substring expression < 0", var); } - if (len == 0 || !val || beg >= strlen(val)) { + if (len <= 0 || !val || beg >= strlen(val)) { arith_err: val = NULL; } else {