rebase: support --no-autostash
[gitweb.git] / path.c
diff --git a/path.c b/path.c
index 757d0b057d3d72842e182864cc0f52b6457e4079..e6089938018b74fb8a6ea547ffc64d428a13daa0 100644 (file)
--- 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);
 }