aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2019-02-08 03:30:11 +0100
committerLibravatar GitHub <noreply@github.com>2019-02-08 03:30:11 +0100
commitf00fbe6861bad18fc0615be8fe5ba0102c609067 (patch)
tree8628735f74dd5cd446745a9a937c3fd5c40845c6
parentseat_configure_tablet_tool: configure xcursor (diff)
parentRevert "Return false if config could not be loaded." (diff)
downloadsway-f00fbe6861bad18fc0615be8fe5ba0102c609067.tar.gz
sway-f00fbe6861bad18fc0615be8fe5ba0102c609067.tar.zst
sway-f00fbe6861bad18fc0615be8fe5ba0102c609067.zip
Merge pull request #3619 from swaywm/revert-3595-ErrorIfConfigNotExist
Revert "Return false if config could not be loaded."
-rw-r--r--sway/config.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/sway/config.c b/sway/config.c
index 0c791a35..ae8d11e3 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -557,22 +557,23 @@ bool load_include_configs(const char *path, struct sway_config *config,
557 const char *parent_dir = dirname(parent_path); 557 const char *parent_dir = dirname(parent_path);
558 558
559 if (chdir(parent_dir) < 0) { 559 if (chdir(parent_dir) < 0) {
560 goto error_chdir; 560 free(parent_path);
561 free(wd);
562 return false;
561 } 563 }
562 564
563 wordexp_t p; 565 wordexp_t p;
564 566
565 if (wordexp(path, &p, 0) != 0) { 567 if (wordexp(path, &p, 0) != 0) {
566 goto error_wordexp; 568 free(parent_path);
569 free(wd);
570 return false;
567 } 571 }
568 572
569 char **w = p.we_wordv; 573 char **w = p.we_wordv;
570 size_t i; 574 size_t i;
571 for (i = 0; i < p.we_wordc; ++i) { 575 for (i = 0; i < p.we_wordc; ++i) {
572 bool found = load_include_config(w[i], parent_dir, config, swaynag); 576 load_include_config(w[i], parent_dir, config, swaynag);
573 if (!found) {
574 goto error_not_found;
575 }
576 } 577 }
577 free(parent_path); 578 free(parent_path);
578 wordfree(&p); 579 wordfree(&p);
@@ -586,16 +587,6 @@ bool load_include_configs(const char *path, struct sway_config *config,
586 587
587 free(wd); 588 free(wd);
588 return true; 589 return true;
589error_not_found:
590 wordfree(&p);
591error_wordexp:
592 if (chdir(wd) < 0) {
593 sway_log(SWAY_ERROR, "failed to restore working directory");
594 }
595error_chdir:
596 free(parent_path);
597 free(wd);
598 return false;
599} 590}
600 591
601void run_deferred_commands(void) { 592void run_deferred_commands(void) {