Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-11 03:12:51 +0300
committerJunio C Hamano <gitster@pobox.com>2010-12-11 03:12:51 +0300
commitaf41867169c6350e2e73a1bfd8f3f2dd5a17bba6 (patch)
tree25c9780c08b03b5e495e6f0b862d694b8f561d11
parent1a3e302a251ed9fb46be9552e1a2a45c73112bb9 (diff)
parent15431ca651050ba315fa4e2e74527f6d115e706c (diff)
Merge branch 'ks/maint-getenv-fix' into maint
* ks/maint-getenv-fix: setup: make sure git_dir path is in a permanent buffer, getenv(3) case
-rw-r--r--environment.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index de5581fe51..18aded6dc4 100644
--- a/environment.c
+++ b/environment.c
@@ -87,6 +87,7 @@ const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = {
static void setup_git_env(void)
{
git_dir = getenv(GIT_DIR_ENVIRONMENT);
+ git_dir = git_dir ? xstrdup(git_dir) : NULL;
if (!git_dir) {
git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
git_dir = git_dir ? xstrdup(git_dir) : NULL;