diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 62fc1c97b7..a495c2538b 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -138,7 +138,8 @@ 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 lvalue '%s' in section '%s', ignoring", lvalue, section); + log_syntax(unit, LOG_WARNING, filename, line, 0, + "Unknown key name '%s' in section '%s', ignoring.", lvalue, section); return 0; } @@ -239,7 +240,6 @@ static int parse_line( } if (sections && !*section) { - if (!(flags & CONFIG_PARSE_RELAXED) && !*section_ignored) log_syntax(unit, LOG_WARNING, filename, line, 0, "Assignment outside of section. Ignoring."); @@ -247,10 +247,12 @@ static int parse_line( } e = strchr(l, '='); - if (!e) { - log_syntax(unit, LOG_WARNING, filename, line, 0, "Missing '='."); - return -EINVAL; - } + if (!e) + return log_syntax(unit, LOG_WARNING, filename, line, 0, + "Missing '=', ignoring line."); + if (e == l) + return log_syntax(unit, LOG_WARNING, filename, line, 0, + "Missing key name before '=', ignoring line."); *e = 0; e++;