summaryrefslogtreecommitdiff
path: root/builtin/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:54 (GMT)
commit773e4088819cb17150afd4929f32bccabb8e2acd (patch)
tree16a345c12e869466049d0c6641b783c32ed84c83 /builtin/config.c
parent15b07cba0b60f0fc5dea0be0d68a355a8161476d (diff)
parent0da0e9268b4825cafb27bb0e07b43fae30bb33da (diff)
downloadgit-773e4088819cb17150afd4929f32bccabb8e2acd.zip
git-773e4088819cb17150afd4929f32bccabb8e2acd.tar.gz
git-773e4088819cb17150afd4929f32bccabb8e2acd.tar.bz2
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
Diffstat (limited to 'builtin/config.c')
-rw-r--r--builtin/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/config.c b/builtin/config.c
index 99bc7ef..98d65bc 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -599,7 +599,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
int nongit = !startup_info->have_repository;
char *value;
- given_config_source.file = getenv(CONFIG_ENVIRONMENT);
+ given_config_source.file = xstrdup_or_null(getenv(CONFIG_ENVIRONMENT));
argc = parse_options(argc, argv, prefix, builtin_config_options,
builtin_config_usage,