conf-parse: use strjoina() where appropriate
This commit is contained in:
parent
46f2d09f31
commit
4472fa6d2c
|
@ -82,19 +82,13 @@ int config_item_perf_lookup(
|
||||||
assert(ltype);
|
assert(ltype);
|
||||||
assert(data);
|
assert(data);
|
||||||
|
|
||||||
if (!section)
|
if (section) {
|
||||||
p = lookup(lvalue, strlen(lvalue));
|
const char *key;
|
||||||
else {
|
|
||||||
char *key;
|
|
||||||
|
|
||||||
key = strjoin(section, ".", lvalue);
|
|
||||||
if (!key)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
|
key = strjoina(section, ".", lvalue);
|
||||||
p = lookup(key, strlen(key));
|
p = lookup(key, strlen(key));
|
||||||
free(key);
|
} else
|
||||||
}
|
p = lookup(lvalue, strlen(lvalue));
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -132,7 +126,6 @@ static int next_assignment(
|
||||||
r = lookup(table, section, lvalue, &func, <ype, &data, userdata);
|
r = lookup(table, section, lvalue, &func, <ype, &data, userdata);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
if (func)
|
if (func)
|
||||||
return func(unit, filename, line, section, section_line,
|
return func(unit, filename, line, section, section_line,
|
||||||
|
|
Loading…
Reference in a new issue