1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Correctly check if a path is a directory. Fix by Brian Korver.

llvm-svn: 115991
This commit is contained in:
Evan Cheng 2010-10-07 22:05:57 +00:00
parent ee23e6ea23
commit 6ff4de5199

View File

@ -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