dont crash if the variable we do substitution on is not set
This commit is contained in:
parent
d68ae08cde
commit
57e746781c
@ -2025,6 +2025,7 @@ static int expand_vars_to_list(o_string *output, int n, char *arg, char or_mask)
|
||||
debug_printf_expand("%s\n", val);
|
||||
} else if (exp_off) {
|
||||
if (exp_op == '%' || exp_op == '#') {
|
||||
if (val) {
|
||||
/* we need to do a pattern match */
|
||||
bool zero;
|
||||
char *loc;
|
||||
@ -2037,6 +2038,7 @@ static int expand_vars_to_list(o_string *output, int n, char *arg, char or_mask)
|
||||
val = loc;
|
||||
else
|
||||
*loc = '\0';
|
||||
}
|
||||
} else {
|
||||
/* we need to do an expansion */
|
||||
int exp_test = (!val || (exp_null && !val[0]));
|
||||
|
Loading…
Reference in New Issue
Block a user