aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-02-08 03:30:11 +0100
committerGitHub <noreply@github.com>2019-02-08 03:30:11 +0100
commitf00fbe6861bad18fc0615be8fe5ba0102c609067 (patch)
tree8628735f74dd5cd446745a9a937c3fd5c40845c6
parentec5da0ca5bad6a433f727499d68ac1352397f5aa (diff)
parent82d7a70b03b43e8e417aeb84803ef04f452bce13 (diff)
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,
const char *parent_dir = dirname(parent_path);
if (chdir(parent_dir) < 0) {
- goto error_chdir;
+ free(parent_path);
+ free(wd);
+ return false;
}
wordexp_t p;
if (wordexp(path, &p, 0) != 0) {
- goto error_wordexp;
+ free(parent_path);
+ free(wd);
+ return false;
}
char **w = p.we_wordv;
size_t i;
for (i = 0; i < p.we_wordc; ++i) {
- bool found = load_include_config(w[i], parent_dir, config, swaynag);
- if (!found) {
- goto error_not_found;
- }
+ load_include_config(w[i], parent_dir, config, swaynag);
}
free(parent_path);
wordfree(&p);
@@ -586,16 +587,6 @@ bool load_include_configs(const char *path, struct sway_config *config,
free(wd);
return true;
-error_not_found:
- wordfree(&p);
-error_wordexp:
- if (chdir(wd) < 0) {
- sway_log(SWAY_ERROR, "failed to restore working directory");
- }
-error_chdir:
- free(parent_path);
- free(wd);
- return false;
}
void run_deferred_commands(void) {