diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-03-26 12:58:19 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-03-26 12:58:19 -0400 |
commit | 504a88434f5ec1ab9361347cd8b3716042ea6dda (patch) | |
tree | c6ed655e5db42ff40d3d1eb2bebe42f8233f7f88 | |
parent | Merge pull request #544 from mikkeloscar/add-include-command (diff) | |
parent | Don't try to read config if not a file. (diff) | |
download | sway-504a88434f5ec1ab9361347cd8b3716042ea6dda.tar.gz sway-504a88434f5ec1ab9361347cd8b3716042ea6dda.tar.zst sway-504a88434f5ec1ab9361347cd8b3716042ea6dda.zip |
Merge pull request #546 from mikkeloscar/include-handle-dir
Don't try to read config if not a file.
-rw-r--r-- | sway/config.c | 6 |
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 @@ | |||
6 | #include <wordexp.h> | 6 | #include <wordexp.h> |
7 | #include <sys/types.h> | 7 | #include <sys/types.h> |
8 | #include <sys/wait.h> | 8 | #include <sys/wait.h> |
9 | #include <sys/stat.h> | ||
9 | #include <signal.h> | 10 | #include <signal.h> |
10 | #include <libinput.h> | 11 | #include <libinput.h> |
11 | #include <limits.h> | 12 | #include <limits.h> |
@@ -245,6 +246,11 @@ static char *get_config_path(void) { | |||
245 | static bool load_config(const char *path, struct sway_config *config) { | 246 | static bool load_config(const char *path, struct sway_config *config) { |
246 | sway_log(L_INFO, "Loading config from %s", path); | 247 | sway_log(L_INFO, "Loading config from %s", path); |
247 | 248 | ||
249 | struct stat sb; | ||
250 | if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { | ||
251 | return false; | ||
252 | } | ||
253 | |||
248 | if (path == NULL) { | 254 | if (path == NULL) { |
249 | sway_log(L_ERROR, "Unable to find a config file!"); | 255 | sway_log(L_ERROR, "Unable to find a config file!"); |
250 | return false; | 256 | return false; |