else {
char *key;
- if (asprintf(&key, "%s.%s", section, lvalue) < 0)
+ key = join(section, ".", lvalue, NULL);
+ if (!key)
return -ENOMEM;
p = lookup(key, strlen(key));
if (r < 0)
return r;
- if (func)
- return func(filename, line, section, lvalue, ltype, rvalue, data, userdata);
+ if (r > 0) {
+ if (func)
+ return func(filename, line, section, lvalue, ltype, rvalue, data, userdata);
+
+ return 0;
+ }
/* Warn about unknown non-extension fields. */
if (!relaxed && !startswith(lvalue, "X-"))
continuation = c;
else {
continuation = strdup(l);
- if (!c) {
+ if (!continuation) {
r = -ENOMEM;
goto finish;
}