← Commit list

a7b52d26c

Denys Vlasenko
Denys Vlasenko
2020-12-23
SUCCESS Duration: 151s

Subject

hush: fix fallout from tweaking ${var:START:LEN} code

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+1 -1
@@ -6617,7 +6617,7 @@ static NOINLINE int expand_one_var(o_string *output, int n,
exp_word = p;
p = strchr(p, SPECIAL_VAR_SYMBOL);
*p = '\0';
- vallen = strlen(val);
+ vallen = val ? strlen(val) : 0;
if (beg < 0) {
/* negative beg counts from the end */
beg = (arith_t)vallen + beg;
shell/hush_test/hush-vars/var_bash_repl_empty_var.right+1 -0
@@ -1,2 +1,3 @@
+w
Ok:0
shell/hush_test/hush-vars/var_bash_repl_empty_var.tests+2 -0
@@ -1,3 +1,5 @@
+unset v
+echo ${v/*/w}
v=''
echo ${v/*/w}
echo Ok:$?