f_substr: Write to stdout when no `-v var_to_set'
Fixes ``setvar: : bad variable name''
This commit is contained in:
parent
679f1eab00
commit
9e81c4fb73
@ -146,7 +146,11 @@ f_substr()
|
||||
fi
|
||||
done
|
||||
|
||||
setvar "$__var_to_set" "$__tmp"
|
||||
if [ "$__var_to_set" ]; then
|
||||
setvar "$__var_to_set" "$__tmp"
|
||||
else
|
||||
echo "$__tmp"
|
||||
fi
|
||||
}
|
||||
|
||||
# f_sprintf $var_to_set $format [$arguments ...]
|
||||
|
Loading…
Reference in New Issue
Block a user