diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-16 11:41:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-16 11:41:27 -0700 |
commit | cd145e72f3c1539e5817cfcf03a5f9fed3685f48 (patch) | |
tree | 79197d7ee861024607df754d62910548e61ca025 /abspath.c | |
parent | 8516c1c231272e3c8fb42ba34306c776e6a90409 (diff) | |
parent | 7d092adc8f4f54d18f5737c155d5b21e45e81a74 (diff) | |
download | git-cd145e72f3c1539e5817cfcf03a5f9fed3685f48.tar.gz |
Merge branch 'js/maint-add-path-stat-pwd' into maint
* js/maint-add-path-stat-pwd:
get_pwd_cwd(): Do not trust st_dev/st_ino blindly
Diffstat (limited to 'abspath.c')
-rw-r--r-- | abspath.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -102,7 +102,8 @@ static const char *get_pwd_cwd(void) pwd = getenv("PWD"); if (pwd && strcmp(pwd, cwd)) { stat(cwd, &cwd_stat); - if (!stat(pwd, &pwd_stat) && + if ((cwd_stat.st_dev || cwd_stat.st_ino) && + !stat(pwd, &pwd_stat) && pwd_stat.st_dev == cwd_stat.st_dev && pwd_stat.st_ino == cwd_stat.st_ino) { strlcpy(cwd, pwd, PATH_MAX); |