1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

shared/conf-parser: emit a nicer warning for something like "======"

Urlich Windl wrote on the mailing list:
> I noticed that a line of "=======" in "[Service]" cases the message " Unknown lvalue '' in section 'Service'".

This now becomes:
/etc/systemd/system/eqeqeqeq.service:3: Missing key name before '=', ignoring line.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-07-18 11:30:43 +02:00
parent 2d4fffb00b
commit 8be8ed8ce1

View File

@ -249,6 +249,9 @@ static int parse_line(
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++;