[llvm-commits] [llvm] r115991 - /llvm/trunk/lib/System/Unix/Path.inc

Evan Cheng evan.cheng at apple.com
Thu Oct 7 15:05:57 PDT 2010


Author: evancheng
Date: Thu Oct  7 17:05:57 2010
New Revision: 115991

URL: http://llvm.org/viewvc/llvm-project?rev=115991&view=rev
Log:
Correctly check if a path is a directory. Fix by Brian Korver.

Modified:
    llvm/trunk/lib/System/Unix/Path.inc

Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=115991&r1=115990&r2=115991&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Thu Oct  7 17:05:57 2010
@@ -439,7 +439,7 @@
   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





More information about the llvm-commits mailing list