From d02bfcd2aa774cfef09c5cc4f6c667b9c6fc98d6 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Thu, 27 Jun 2019 17:33:04 +0300 Subject: [PATCH] config: skip empty lines and comments (starting with #) --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 2a3fd6f4..33d40d56 100644 --- a/src/main.c +++ b/src/main.c @@ -130,7 +130,9 @@ parse_commands_file (struct WpDaemonData *d, GInputStream * stream, /* tokenize and execute */ cmd = strtok_r (linestart, " ", &saveptr); - if (!g_strcmp0 (cmd, "load-module")) { + if (!cmd || cmd[0] == '#') { + /* empty line or comment, skip */ + } else if (!g_strcmp0 (cmd, "load-module")) { abi = strtok_r (NULL, " ", &saveptr); module = strtok_r (NULL, " ", &saveptr); -- GitLab