summaryrefslogtreecommitdiffstats
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-07-28 00:01:36 +0200
committerJunio C Hamano <gitster@pobox.com>2010-07-28 00:01:36 +0200
commite5498e8a9f9a596ecff78426bbf904626cd7863a (patch)
tree0d8f2d6df322847817a42cc371c78984125a3190 /path.c
parentMerge branch 'maint-1.7.0' into maint-1.7.1 (diff)
parentGit 1.7.0.7 (diff)
downloadgit-e5498e8a9f9a596ecff78426bbf904626cd7863a.tar.xz
git-e5498e8a9f9a596ecff78426bbf904626cd7863a.zip
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);