]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: fix line number in error message 14964/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Feb 2020 17:37:11 +0000 (02:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Feb 2020 17:37:15 +0000 (02:37 +0900)
Fixes #14929.

src/shared/conf-parser.c

index 318588cc1fd6b93db1527cb3757a340768c72d00..657df0a517a1bb96a9547f7f21c3ae1df9a2ecd6 100644 (file)
@@ -334,6 +334,8 @@ int config_parse(const char *unit,
                         return r;
                 }
 
+                line++;
+
                 l = skip_leading_chars(buf, WHITESPACE);
                 if (*l != '\0' && strchr(COMMENTS, *l))
                         continue;
@@ -390,7 +392,7 @@ int config_parse(const char *unit,
 
                 r = parse_line(unit,
                                filename,
-                               ++line,
+                               line,
                                sections,
                                lookup,
                                table,