diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-10-07 22:05:57 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-10-07 22:05:57 +0000 |
commit | a98111cf15bdb2cf06361dfd92afb3d2d0a3b8d8 (patch) | |
tree | 5b4bf3c612020ce8693d08a8eafd5a368928303e /lib/System/Unix/Path.inc | |
parent | 7b172c6ae6c4fea90db785902b4326afb21ad584 (diff) |
Correctly check if a path is a directory. Fix by Brian Korver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix/Path.inc')
-rw-r--r-- | lib/System/Unix/Path.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index 184da1e27a..4c97c4b71c 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -439,7 +439,7 @@ Path::isDirectory() const { struct stat buf; if (0 != stat(path.c_str(), &buf)) return false; - return buf.st_mode & S_IFDIR ? true : false; + return ((buf.st_mode & S_IFMT) == S_IFDIR) ? true : false; } bool |