]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timedated: fix skipping of comments in config file
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 8 Mar 2021 19:49:53 +0000 (20:49 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Mar 2021 16:35:57 +0000 (17:35 +0100)
Reading file '/usr/lib/systemd/ntp-units.d/80-systemd-timesync.list'
Failed to add NTP service "# This file is part of systemd.", ignoring: Invalid argument
Failed to add NTP service "# See systemd-timedated.service(8) for more information.", ignoring: Invalid argument

:(

(cherry picked from commit 03a81441b1a490f8fc2a19aeb9b23299657c380c)

src/timedate/timedated.c

index 77c6cf0ad4121ad14671ac905d3918eab762620d..76fe04900dcb33c059ff150d4c7626c422b79a65 100644 (file)
@@ -211,7 +211,7 @@ static int context_parse_ntp_services_from_disk(Context *c) {
                                 break;
 
                         word = strstrip(line);
-                        if (isempty(word) || startswith("#", word))
+                        if (isempty(word) || startswith(word, "#"))
                                 continue;
 
                         r = context_add_ntp_service(c, word, *f);