From 6ee6c1fd904247183d6d0088b5137dd0991a4410 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 3 Mar 2016 10:40:47 +1000 Subject: [PATCH] * config.c : better detection of comments at end of line --- src/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 0dc254f..724156b 100644 --- a/src/config.c +++ b/src/config.c @@ -33,8 +33,10 @@ f2b_config_parse_kv_pair(const char *src) { value++; /* strip trailing comment */ - if ((p = strstr(value, " #")) || (p = strstr(value, "\t#"))) - *p = '\0'; + if ((p = strstr(value, " #")) != NULL) *p = '\0'; + if ((p = strstr(value, "\t#")) != NULL) *p = '\0'; + if ((p = strstr(value, " ;")) != NULL) *p = '\0'; + if ((p = strstr(value, "\t;")) != NULL) *p = '\0'; /* strip trailing spaces */ p = value + strlen(value);