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 251f859b23
commit 139edad73a
1 changed files with 1 additions and 1 deletions

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