diff options
author | 2015-11-29 14:02:58 -0500 | |
---|---|---|
committer | 2015-11-29 14:02:58 -0500 | |
commit | 5a369b3132a5f79afb4d65ec87562b473b4b29dd (patch) | |
tree | 1b892102e07f8a7cf57fcf6838e95f113266cf55 /sway | |
parent | Fix output adjustment for panels (diff) | |
download | sway-5a369b3132a5f79afb4d65ec87562b473b4b29dd.tar.gz sway-5a369b3132a5f79afb4d65ec87562b473b4b29dd.tar.zst sway-5a369b3132a5f79afb4d65ec87562b473b4b29dd.zip |
Only strip comments at the start of a line
This is necessary because i3 config files use CSS notation for colors
(i.e. #rrggbb).
Diffstat (limited to 'sway')
-rw-r--r-- | sway/config.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/config.c b/sway/config.c index dd466e5b..67b442ad 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -207,7 +207,10 @@ bool read_config(FILE *file, bool is_active) { | |||
207 | while (!feof(file)) { | 207 | while (!feof(file)) { |
208 | line = read_line(file); | 208 | line = read_line(file); |
209 | line_number++; | 209 | line_number++; |
210 | line = strip_comments(line); | 210 | line = strip_whitespace(line); |
211 | if (line[0] == '#') { | ||
212 | continue; | ||
213 | } | ||
211 | struct cmd_results *res = config_command(line); | 214 | struct cmd_results *res = config_command(line); |
212 | switch(res->status) { | 215 | switch(res->status) { |
213 | case CMD_FAILURE: | 216 | case CMD_FAILURE: |
@@ -261,8 +264,7 @@ bool read_config(FILE *file, bool is_active) { | |||
261 | return success; | 264 | return success; |
262 | } | 265 | } |
263 | 266 | ||
264 | int output_name_cmp(const void *item, const void *data) | 267 | int output_name_cmp(const void *item, const void *data) { |
265 | { | ||
266 | const struct output_config *output = item; | 268 | const struct output_config *output = item; |
267 | const char *name = data; | 269 | const char *name = data; |
268 | 270 | ||