diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-18 11:30:43 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-18 11:39:38 +0200 |
commit | 8be8ed8ce1ed30450b6caf6e7dcf6dd28080e1f6 (patch) | |
tree | 7bb6227d5dc37138293ce54e6a31b020d0c7b68c /src/shared/conf-parser.c | |
parent | shared/conf-parser: be nice and ignore lines without "=" (diff) | |
download | systemd-8be8ed8ce1ed30450b6caf6e7dcf6dd28080e1f6.tar.xz systemd-8be8ed8ce1ed30450b6caf6e7dcf6dd28080e1f6.zip |
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.
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r-- | src/shared/conf-parser.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index c3af230870..b4ebc0f44b 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -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++; |