hush: fix fallout from tweaking ${var:START:LEN} code
function old new delta expand_one_var 2344 2353 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -6617,7 +6617,7 @@ static NOINLINE int expand_one_var(o_string *output, int n,
|
|||||||
exp_word = p;
|
exp_word = p;
|
||||||
p = strchr(p, SPECIAL_VAR_SYMBOL);
|
p = strchr(p, SPECIAL_VAR_SYMBOL);
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
vallen = strlen(val);
|
vallen = val ? strlen(val) : 0;
|
||||||
if (beg < 0) {
|
if (beg < 0) {
|
||||||
/* negative beg counts from the end */
|
/* negative beg counts from the end */
|
||||||
beg = (arith_t)vallen + beg;
|
beg = (arith_t)vallen + beg;
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
|
|
||||||
|
w
|
||||||
Ok:0
|
Ok:0
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
unset v
|
||||||
|
echo ${v/*/w}
|
||||||
v=''
|
v=''
|
||||||
echo ${v/*/w}
|
echo ${v/*/w}
|
||||||
echo Ok:$?
|
echo Ok:$?
|
||||||
|
Reference in New Issue
Block a user