summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:52 (GMT)
commit6a015cecbe662b00c8ac697b95d966def569f4e7 (patch)
tree7dd372307992ca578cbc9ae9e8847f2c0ec563aa
parent16a465bc018d09e9d7bbbdc5f40a7fb99c21f8ef (diff)
parent6776a84dae701723721e2ff050acc57d63eeb59c (diff)
downloadgit-6a015cecbe662b00c8ac697b95d966def569f4e7.zip
git-6a015cecbe662b00c8ac697b95d966def569f4e7.tar.gz
git-6a015cecbe662b00c8ac697b95d966def569f4e7.tar.bz2
Merge branch 'kg/external-diff-save-env'
The code to drive GIT_EXTERNAL_DIFF command relied on the string returned from getenv() to be non-volatile, which is not true, that has been corrected. * kg/external-diff-save-env: diff: ensure correct lifetime of external_diff_cmd
-rw-r--r--diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 1b5f276..b96b7a4 100644
--- a/diff.c
+++ b/diff.c
@@ -493,7 +493,7 @@ static const char *external_diff(void)
if (done_preparing)
return external_diff_cmd;
- external_diff_cmd = getenv("GIT_EXTERNAL_DIFF");
+ external_diff_cmd = xstrdup_or_null(getenv("GIT_EXTERNAL_DIFF"));
if (!external_diff_cmd)
external_diff_cmd = external_diff_cmd_cfg;
done_preparing = 1;