[llvm-commits] [llvm] r115991 - /llvm/trunk/lib/System/Unix/Path.inc
Dimitry Andric
dimitry at andric.com
Thu Oct 7 15:14:04 PDT 2010
On 2010-10-08 00:05, Evan Cheng wrote:
...
> Correctly check if a path is a directory. Fix by Brian Korver.
...
> - return buf.st_mode& S_IFDIR ? true : false;
> + return ((buf.st_mode& S_IFMT) == S_IFDIR) ? true : false;
Actually, it is probably better to use the S_ISDIR() macro instead,
which is there for precisely this purpose:
return S_ISDIR(buf.st_mode) ? true : false;
More information about the llvm-commits
mailing list