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 | 139edad73abe7c6a9c552faa1b8121168f4271eb (patch) | |
tree | d53078a2de20ed45527c1d38bc9e0809c21f7908 /llvm/lib/System | |
parent | 251f859b2321b5cc82dee7249dda4a19a4388bb0 (diff) | |
download | bcm5719-llvm-139edad73abe7c6a9c552faa1b8121168f4271eb.tar.gz bcm5719-llvm-139edad73abe7c6a9c552faa1b8121168f4271eb.zip |
Correctly check if a path is a directory. Fix by Brian Korver.
llvm-svn: 115991
Diffstat (limited to 'llvm/lib/System')
-rw-r--r-- | llvm/lib/System/Unix/Path.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index 184da1e27ac..4c97c4b71cc 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/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 |