From cdc73fd95e569c02e6b22762276e975a89a90c0f Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sat, 26 Mar 2016 17:11:18 +0100 Subject: Don't try to read config if not a file. --- sway/config.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index c30c1767..a877261c 100644 --- a/sway/config.c +++ b/sway/config.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -245,6 +246,11 @@ static char *get_config_path(void) { static bool load_config(const char *path, struct sway_config *config) { sway_log(L_INFO, "Loading config from %s", path); + struct stat sb; + if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { + return false; + } + if (path == NULL) { sway_log(L_ERROR, "Unable to find a config file!"); return false; -- cgit v1.2.3