Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'ks/maint-getenv-fix' into maint
author
Junio C Hamano
<gitster@pobox.com>
Sat, 11 Dec 2010 00:12:51 +0000
(16:12 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 11 Dec 2010 00:12:51 +0000
(16:12 -0800)
* ks/maint-getenv-fix:
setup: make sure git_dir path is in a permanent buffer, getenv(3) case
environment.c
patch
|
blob
|
history
raw
(from parent 1:
1a3e302
)
diff --git
a/environment.c
b/environment.c
index de5581fe51d532231b0121bd2ef2e46669015bda..18aded6dc433ebc19c8b34e8ebcf59979a1985f6 100644
(file)
--- 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;