aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/imv.c5
1 files changed, 5 insertions, 0 deletions
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);