diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index 184da1e27ac..4c97c4b71cc 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