From 5116338a9c7be16ccccd736d114960ec3e80b430 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Tue, 18 Aug 2015 11:50:25 +0200 Subject: [PATCH] Fix inline comments in the config file. --- sway/config.c | 1 + sway/stringop.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sway/config.c b/sway/config.c index f06d55f8..093f502e 100644 --- a/sway/config.c +++ b/sway/config.c @@ -190,6 +190,7 @@ bool read_config(FILE *file, bool is_active) { char *line = read_line(file); line = strip_whitespace(line, &_); line = strip_comments(line); + line = strip_whitespace(line, &_); if (!line[0]) { goto _continue; } diff --git a/sway/stringop.c b/sway/stringop.c index 1dff97bf..cbaa69b9 100644 --- a/sway/stringop.c +++ b/sway/stringop.c @@ -40,7 +40,7 @@ char *strip_comments(char *str) { } else if (str[i] == '\'' && !in_string) { in_character = !in_character; } else if (!in_character && !in_string) { - if (str[i] == '#' && i == 0) { + if (str[i] == '#') { str[i] = '\0'; break; }