mirror of
https://github.com/swaywm/sway.git
synced 2024-11-24 08:51:27 +00:00
Fix inline comments in the config file.
This commit is contained in:
parent
2f8a239248
commit
5116338a9c
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue