aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-17 08:12:14 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-17 08:12:14 +0000
commitde575ac58efa65180c3c22e427de612dbdc26706 (patch)
tree0a640f952051748e7581cce82a73d4fa165dc81b /main.c
parentmain: allow user to override shell on the command line (diff)
conf: improve configuration file parsing
* Strip whitespaces from keys and values * Detect (and ignore) comments * Detect syntax errors (no value specified etc) * Error out on syntax errors and invalid keys
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index faf8b926..18673401 100644
--- a/main.c
+++ b/main.c
@@ -273,7 +273,9 @@ main(int argc, char *const *argv)
{
int ret = EXIT_FAILURE;
- struct config conf = config_load();
+ struct config conf = {NULL};
+ if (!config_load(&conf))
+ return ret;
static const struct option longopts[] = {
{"font", required_argument, 0, 'f'},