Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'js/maint-add-path-stat-pwd' into maint
author
Junio C Hamano
<gitster@pobox.com>
Tue, 16 Aug 2011 18:41:27 +0000
(11:41 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 16 Aug 2011 18:41:27 +0000
(11:41 -0700)
* js/maint-add-path-stat-pwd:
get_pwd_cwd(): Do not trust st_dev/st_ino blindly
abspath.c
patch
|
blob
|
history
raw
(from parent 1:
8516c1c
)
diff --git
a/abspath.c
b/abspath.c
index 3005aedde68b48297aacd2082797b2e2f249b094..f9494c49c17cf421a2efa7c6562bc84fcac014f6 100644
(file)
--- a/
abspath.c
+++ b/
abspath.c
@@
-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);