mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-25 01:40:19 -05:00
Require trailing comment to be preceded by a space or tab
Fixes `word-delimiters` option to not ignore `#` and subsequent characters. Closes #270
This commit is contained in:
parent
9c705b26ee
commit
0aa086065c
2 changed files with 19 additions and 3 deletions
|
|
@ -24,6 +24,11 @@
|
||||||
## 1.6.3
|
## 1.6.3
|
||||||
### Added
|
### Added
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
* Trailing comments in `foot.ini` must now be preceded by a space or tab
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/270)
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
@ -35,6 +40,8 @@
|
||||||
* Erased, overflowing glyphs (when
|
* Erased, overflowing glyphs (when
|
||||||
`tweak.allow-overflowing-double-width-glyphs=yes` - the default) not
|
`tweak.allow-overflowing-double-width-glyphs=yes` - the default) not
|
||||||
properly erasing the cell overflowed **into**.
|
properly erasing the cell overflowed **into**.
|
||||||
|
* `word-delimiters` option ignores `#` and subsequent characters
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/270)
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
15
config.c
15
config.c
|
|
@ -1731,9 +1731,18 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar
|
||||||
if (line[0] == '\0' || line[0] == '#')
|
if (line[0] == '\0' || line[0] == '#')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Split up into key/value pair + trailing comment */
|
/* Split up into key/value pair + trailing comment separated by blank */
|
||||||
char *key_value = strtok(line, "#");
|
char *key_value = line;
|
||||||
char UNUSED *comment = strtok(NULL, "\n");
|
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 */
|
/* Check for new section */
|
||||||
if (key_value[0] == '[') {
|
if (key_value[0] == '[') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue