From ad63ab512cabf68050259d33f540ad16918f5046 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Wed, 29 Nov 2017 19:53:02 +0000 Subject: Allow config path to be specified with $imv_config --- src/imv.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/imv.c b/src/imv.c index 1bd5821..53ab263 100644 --- a/src/imv.c +++ b/src/imv.c @@ -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); -- cgit v1.2.3