]> 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)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Mar 2021 05:04:21 +0000 (14:04 +0900)
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

:(

src/timedate/timedated.c

index 1257d950aee60e62a406f00c3b5d143f231bd533..567244dc244ede65bc89285c27dd7ef85ba2e0a9 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);