summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-18 11:30:43 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-18 11:39:38 +0200
commit8be8ed8ce1ed30450b6caf6e7dcf6dd28080e1f6 (patch)
tree7bb6227d5dc37138293ce54e6a31b020d0c7b68c /src/shared/conf-parser.c
parent2d4fffb00bbf528683946ee04e04980549124b0a (diff)
downloadsystemd-8be8ed8ce1ed30450b6caf6e7dcf6dd28080e1f6.tar.gz
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.c3
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++;