diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-29 14:02:58 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-29 14:02:58 -0500 |
commit | 5a369b3132a5f79afb4d65ec87562b473b4b29dd (patch) | |
tree | 1b892102e07f8a7cf57fcf6838e95f113266cf55 /sway/config.c | |
parent | ef91764bc721633b335af8d5be051db21a9b7eea (diff) |
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/config.c')
-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) { while (!feof(file)) { line = read_line(file); line_number++; - line = strip_comments(line); + line = strip_whitespace(line); + if (line[0] == '#') { + continue; + } struct cmd_results *res = config_command(line); switch(res->status) { case CMD_FAILURE: @@ -261,8 +264,7 @@ bool read_config(FILE *file, bool is_active) { return success; } -int output_name_cmp(const void *item, const void *data) -{ +int output_name_cmp(const void *item, const void *data) { const struct output_config *output = item; const char *name = data; |