summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-07-27 15:01:36 -0700
committerJunio C Hamano <gitster@pobox.com>2010-07-27 15:01:36 -0700
commite5498e8a9f9a596ecff78426bbf904626cd7863a (patch)
tree0d8f2d6df322847817a42cc371c78984125a3190 /path.c
parentc4818faf81d32d940c58ab209f83b6049b33ecbb (diff)
parent593ce2bea5dad436e87b5dd37c205961d73feae9 (diff)
downloadgit-e5498e8a9f9a596ecff78426bbf904626cd7863a.tar.gz
Sync with 1.7.0 series
Diffstat (limited to 'path.c')
-rw-r--r--path.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/path.c b/path.c
index b4c8d91722..6b23023095 100644
--- a/path.c
+++ b/path.c
@@ -316,6 +316,8 @@ char *expand_user_path(const char *path)
size_t username_len = first_slash - username;
if (username_len == 0) {
const char *home = getenv("HOME");
+ if (!home)
+ goto return_null;
strbuf_add(&user_path, home, strlen(home));
} else {
struct passwd *pw = getpw_str(username, username_len);