mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
config: clean up
Better parsing means we catch syntax errors earlier, meaning we can remove some of the checks.
This commit is contained in:
parent
73b33afff2
commit
91da76656c
1 changed files with 1 additions and 10 deletions
11
config.c
11
config.c
|
|
@ -1136,7 +1136,7 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar
|
|||
}
|
||||
|
||||
/* Strip trailing whitespace from key (leading stripped earlier) */
|
||||
if (key[0] != '\0') {
|
||||
{
|
||||
assert(!isspace(*key));
|
||||
|
||||
char *end = key + strlen(key) - 1;
|
||||
|
|
@ -1145,15 +1145,6 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar
|
|||
*(end + 1) = '\0';
|
||||
}
|
||||
|
||||
if (value == NULL) {
|
||||
if (key != NULL && strlen(key) > 0 && key[0] != '#') {
|
||||
LOG_AND_NOTIFY_ERR("%s:%d: syntax error: %s", path, lineno, key_value);
|
||||
error_or_continue();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Strip leading+trailing whitespace from value */
|
||||
{
|
||||
while (isspace(*value))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue