[core] adjust parser for valid variable expansion

adjust config parser for valid variable expansion
Return only the value when a variable is expanded so that the
array element keeps its state as value-only or part of key-value

(thx nicorac)

x-ref:
  "https://redmine.lighttpd.net/boards/2/topics/7600"
This commit is contained in:
Glenn Strauss 2017-10-20 23:04:53 -04:00
parent 77bdaa3a93
commit 41eb4d323c
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ static data_unset *configparser_get_variable(config_t *ctx, const buffer *key) {
array_print(dc->value, 0);
#endif
if (NULL != (du = array_get_element_klen(dc->value, CONST_BUF_LEN(key)))) {
return du->copy(du);
du = du->copy(du);
buffer_reset(du->key);
return du;
}
}
return NULL;