diff options
| author | Peter Colberg <peter@colberg.org> | 2021-01-03 19:08:25 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-21 10:52:14 +0000 |
| commit | 0aa086065c5bb0eef3ea53ed0f3e464ebcbb6853 (patch) | |
| tree | f091f2b088bd4b2e3b7d4d1564e12ccf5195f126 | |
| parent | render: mark cell overflowed into as dirty (diff) | |
Require trailing comment to be preceded by a space or tab
Fixes `word-delimiters` option to not ignore `#` and subsequent characters.
Closes #270
| -rw-r--r-- | CHANGELOG.md | 7 | ||||
| -rw-r--r-- | config.c | 15 |
2 files changed, 19 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb6fe1a..4246f025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,11 @@ ## 1.6.3 ### Added ### Changed + +* Trailing comments in `foot.ini` must now be preceded by a space or tab + (https://codeberg.org/dnkl/foot/issues/270) + + ### Deprecated ### Removed ### Fixed @@ -35,6 +40,8 @@ * Erased, overflowing glyphs (when `tweak.allow-overflowing-double-width-glyphs=yes` - the default) not properly erasing the cell overflowed **into**. +* `word-delimiters` option ignores `#` and subsequent characters + (https://codeberg.org/dnkl/foot/issues/270) ### Security @@ -1731,9 +1731,18 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar if (line[0] == '\0' || line[0] == '#') continue; - /* Split up into key/value pair + trailing comment */ - char *key_value = strtok(line, "#"); - char UNUSED *comment = strtok(NULL, "\n"); + /* Split up into key/value pair + trailing comment separated by blank */ + char *key_value = line; + char *comment = line; + while (comment[0] != '\0') { + const char c = comment[0]; + comment++; + if (isblank(c) && comment[0] == '#') { + comment[0] = '\0'; /* Terminate key/value pair */ + comment++; + break; + } + } /* Check for new section */ if (key_value[0] == '[') { |
