From 5de239f6a78663339e2ca496c66055f9578239de Mon Sep 17 00:00:00 2001 From: Sebastien Chapuis Date: Wed, 27 Jul 2016 23:53:11 +0200 Subject: [PATCH] Fix #60: Remove comment from theme string --- src/lightdm-webkit2-greeter.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lightdm-webkit2-greeter.c b/src/lightdm-webkit2-greeter.c index d61ddf9..d3232b2 100644 --- a/src/lightdm-webkit2-greeter.c +++ b/src/lightdm-webkit2-greeter.c @@ -250,6 +250,14 @@ quit_cb(void) { gtk_main_quit(); } +static gchar * +remove_comments(gchar *str) { + gchar *ptr; + + if (str && (ptr = strchr(str, '#'))) + *ptr = 0; + return g_strstrip(str); +} int main(int argc, char **argv) { @@ -287,6 +295,7 @@ main(int argc, char **argv) { G_KEY_FILE_NONE, NULL); theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL); + theme = remove_comments(theme); config_timeout = g_key_file_get_integer(keyfile, "greeter", "screensaver-timeout", NULL); debug_mode = g_key_file_get_boolean(keyfile, "greeter", "debug_mode", NULL);