aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 0bf8972..4dadd97 100644
--- a/cgit.c
+++ b/cgit.c
@@ -486,8 +486,10 @@ static int prepare_repo_cmd(struct cgit_context *ctx)
486 init_display_notes(NULL); 486 init_display_notes(NULL);
487 487
488 /* We restore the unset variables afterward. */ 488 /* We restore the unset variables afterward. */
489 setenv("HOME", user_home, 1); 489 if (user_home)
490 setenv("XDG_CONFIG_HOME", xdg_home, 1); 490 setenv("HOME", user_home, 1);
491 if (xdg_home)
492 setenv("XDG_CONFIG_HOME", xdg_home, 1);
491 493
492 if (nongit) { 494 if (nongit) {
493 const char *name = ctx->repo->name; 495 const char *name = ctx->repo->name;