mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 15:36:29 +01:00
Merge pull request #546 from mikkeloscar/include-handle-dir
Don't try to read config if not a file.
This commit is contained in:
commit
504a88434f
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue