summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--path.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/path.c b/path.c
index c36f003..1b6cdc4 100644
--- a/path.c
+++ b/path.c
@@ -148,10 +148,12 @@ void home_config_paths(char **global, char **xdg, char *file)
*global = mkpathdup("%s/.gitconfig", home);
}
- if (!xdg_home)
- *xdg = NULL;
- else
- *xdg = mkpathdup("%s/git/%s", xdg_home, file);
+ if (xdg) {
+ if (!xdg_home)
+ *xdg = NULL;
+ else
+ *xdg = mkpathdup("%s/git/%s", xdg_home, file);
+ }
free(to_free);
}