Merge branch 'jk/save-getenv-result'
There were many places the code relied on the string returned from getenv() to be non-volatile, which is not true, that have been corrected. * jk/save-getenv-result: builtin_diff(): read $GIT_DIFF_OPTS closer to use merge-recursive: copy $GITHEAD strings init: make a copy of $GIT_DIR string config: make a copy of $GIT_CONFIG string commit: copy saved getenv() result get_super_prefix(): copy getenv() result
This commit is contained in:
@ -107,7 +107,7 @@ char *git_work_tree_cfg;
|
||||
|
||||
static char *git_namespace;
|
||||
|
||||
static const char *super_prefix;
|
||||
static char *super_prefix;
|
||||
|
||||
/*
|
||||
* Repository-local GIT_* environment variables; see cache.h for details.
|
||||
@ -240,7 +240,7 @@ const char *get_super_prefix(void)
|
||||
{
|
||||
static int initialized;
|
||||
if (!initialized) {
|
||||
super_prefix = getenv(GIT_SUPER_PREFIX_ENVIRONMENT);
|
||||
super_prefix = xstrdup_or_null(getenv(GIT_SUPER_PREFIX_ENVIRONMENT));
|
||||
initialized = 1;
|
||||
}
|
||||
return super_prefix;
|
||||
|
Reference in New Issue
Block a user