mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
shared/conf-parser: do not print "(null)" as section name
Before: /etc/kernel/install.conf:6: Unknown key name 'asdf' in section '(null)', ignoring. After: /etc/kernel/install.conf:6: Unknown key 'asdf', ignoring. Also make the message a bit better.
This commit is contained in:
@@ -160,7 +160,11 @@ static int next_assignment(
|
||||
/* Warn about unknown non-extension fields. */
|
||||
if (!(flags & CONFIG_PARSE_RELAXED) && !startswith(lvalue, "X-"))
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||
"Unknown key name '%s' in section '%s', ignoring.", lvalue, section);
|
||||
"Unknown key '%s'%s%s%s, ignoring.",
|
||||
lvalue,
|
||||
section ? " in section [" : "",
|
||||
strempty(section),
|
||||
section ? "]" : "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user