config: make a copy of $GIT_CONFIG string
commit423ff9bef003b41f81949e7a88d7278b48334ed4
authorJeff King <peff@peff.net>
Fri, 11 Jan 2019 22:15:54 +0000 (11 17:15 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 12 Jan 2019 02:48:58 +0000 (11 18:48 -0800)
tree87cf31398c7255de50608f58048e58260eb7575b
parent406bab3811a220400da6a43da71346cbfc466fc9
config: make a copy of $GIT_CONFIG string

cmd_config() points our source filename pointer at the return value of
getenv(), but that value may be invalidated by further calls to
environment functions. Let's copy it to make sure it remains valid.

We don't need to bother freeing it, as it remains part of the
whole-process global state until we exit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c