aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2017-11-29 19:53:02 +0000
committerHarry Jeffery <harry@exec64.co.uk>2017-11-29 19:53:02 +0000
commitad63ab512cabf68050259d33f540ad16918f5046 (patch)
treed6919d05ace2bf66e3c80bdbf06d0f1304fdb396 /src
parent87b65021436996cb999a818469853c93cbde5150 (diff)
downloadimv-ad63ab512cabf68050259d33f540ad16918f5046.tar.gz
Allow config path to be specified with $imv_config
Diffstat (limited to 'src')
-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);