diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-07-22 14:43:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-07-22 14:43:36 -0700 |
commit | b07522797915c1f907d7b7547510e659ddf01df5 (patch) | |
tree | 29ee71e26c22f456f7020ab067bf3003948c2c7e /abspath.c | |
parent | c8409e716a8a117ee37fb0c4b8ecbfcc4bac3fe9 (diff) | |
parent | 7d092adc8f4f54d18f5737c155d5b21e45e81a74 (diff) | |
download | git-b07522797915c1f907d7b7547510e659ddf01df5.tar.gz |
Merge branch 'js/maint-add-path-stat-pwd'
* 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); |