summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2016-03-26 12:58:19 -0400
committerFurkan Sahin <furkan-dev@proton.me>2016-03-26 12:58:19 -0400
commitcd6f0bb6ca3d45db4aaed3c16ff6aaf309f578b0 (patch)
treec6ed655e5db42ff40d3d1eb2bebe42f8233f7f88
parent9df2ad0964103f6869e45f1428ec629ed637367f (diff)
parentc566bfdc7bf41399c28c0f57940080a6304e1c44 (diff)
Merge pull request #546 from mikkeloscar/include-handle-dir
Don't try to read config if not a file.
-rw-r--r--sway/config.c6
1 files changed, 6 insertions, 0 deletions
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 <wordexp.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/stat.h>
#include <signal.h>
#include <libinput.h>
#include <limits.h>
@@ -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;