aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-02-05 01:59:40 -0500
committerLibravatar emersion <contact@emersion.fr>2019-02-05 09:33:45 +0100
commit920c64f569183cfa27923b928c8d19ea56a41332 (patch)
tree2d2e2affc4c11bd8a95c511345d065ccfa9e7592 /sway/config.c
parentMerge pull request #3562 from vilhalmer/focus_follows_mouse-workspace-last-in... (diff)
downloadsway-920c64f569183cfa27923b928c8d19ea56a41332.tar.gz
sway-920c64f569183cfa27923b928c8d19ea56a41332.tar.zst
sway-920c64f569183cfa27923b928c8d19ea56a41332.zip
load_include_configs: fix wordexp fail condition
This fixes the failure condition for the wordexp call in load_include_configs. The only success value is zero. Since the error codes are positive, having the check be less than zero was causing segfaults on failure when accessing the words.
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index ee1c42df..0c23fad8 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -557,7 +557,7 @@ bool load_include_configs(const char *path, struct sway_config *config,
557 557
558 wordexp_t p; 558 wordexp_t p;
559 559
560 if (wordexp(path, &p, 0) < 0) { 560 if (wordexp(path, &p, 0) != 0) {
561 free(parent_path); 561 free(parent_path);
562 free(wd); 562 free(wd);
563 return false; 563 return false;