From 48dc3d2458b3dcf8a38171bb701bf0116f2b1362 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Wed, 6 Dec 2017 14:48:22 +0100 Subject: [PATCH] Fail when config file given via option not found --- src/settings.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/settings.c b/src/settings.c index fe6aff4..c6319d9 100644 --- a/src/settings.c +++ b/src/settings.c @@ -79,6 +79,13 @@ void load_settings(char *cmdline_config_path) if (cmdline_config_path != NULL) { config_file = fopen(cmdline_config_path, "r"); + + if(!config_file) { + char *msg = g_strdup_printf( + "Cannot find config file: '%s'\n", + cmdline_config_path); + die(msg, 1); + } } if (config_file == NULL) { config_file = xdgConfigOpen("dunst/dunstrc", "r", &xdg);