aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-02 18:01:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-02 18:01:07 +0000
commit91da76656c415da8cf62b0cef9f7394ce2a8b1fe (patch)
treef04661b1d731dd413ebc2eb11831d7ca841a338e
parentMerge branch 'socket-path-uses-wayland-display-instead-of-xdg-session-id' into master (diff)
config: clean up
Better parsing means we catch syntax errors earlier, meaning we can remove some of the checks.
-rw-r--r--config.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/config.c b/config.c
index 2976c6a4..26d2d1a0 100644
--- a/config.c
+++ b/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))