diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2017-11-29 19:53:02 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2017-11-29 19:53:02 +0000 |
commit | ad63ab512cabf68050259d33f540ad16918f5046 (patch) | |
tree | d6919d05ace2bf66e3c80bdbf06d0f1304fdb396 | |
parent | 87b65021436996cb999a818469853c93cbde5150 (diff) | |
download | imv-ad63ab512cabf68050259d33f540ad16918f5046.tar.gz |
Allow config path to be specified with $imv_config
-rw-r--r-- | src/imv.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -833,6 +833,7 @@ static void render_window(struct imv *imv) static char *get_config_path(void) { const char *config_paths[] = { + "$imv_config", "$HOME/.imv_config", "$HOME/.imv/config", "$XDG_CONFIG_HOME/imv/config", @@ -843,6 +844,10 @@ static char *get_config_path(void) for(size_t i = 0; i < sizeof(config_paths) / sizeof(char*); ++i) { wordexp_t word; if(wordexp(config_paths[i], &word, 0) == 0) { + if (!word.we_wordv[0]) { + continue; + } + char *path = strdup(word.we_wordv[0]); wordfree(&word); |