X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/410da3ac1cdb002116c08f143ce82534897ede27..8d8e84e72a24f474a6659ca04d0906723b2ac975:/cgit.c 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) init_display_notes(NULL); /* We restore the unset variables afterward. */ - setenv("HOME", user_home, 1); - setenv("XDG_CONFIG_HOME", xdg_home, 1); + if (user_home) + setenv("HOME", user_home, 1); + if (xdg_home) + setenv("XDG_CONFIG_HOME", xdg_home, 1); if (nongit) { const char *name = ctx->repo->name;