diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-07-12 14:40:14 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-07-12 14:40:14 (GMT) |
commit | 219bcf25ba5d6dca20971373266c2d02e75b50e0 (patch) | |
tree | 5010709793c97ac0c78357d9211dba5066662459 /Source/kwsys | |
parent | 2dc914c8399c038946dd4569b4ff435ad9618426 (diff) | |
download | CMake-219bcf25ba5d6dca20971373266c2d02e75b50e0.zip CMake-219bcf25ba5d6dca20971373266c2d02e75b50e0.tar.gz CMake-219bcf25ba5d6dca20971373266c2d02e75b50e0.tar.bz2 |
BUG: When removing directory, use lstat instead of stat to make sure that symlinks are treated as files and not as directories
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index f5c4507..157ea55 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2044,7 +2044,11 @@ kwsys_stl::string SystemTools bool SystemTools::FileIsDirectory(const char* name) { struct stat fs; +#if _WIN32 if(stat(name, &fs) == 0) +#else + if(lstat(name, &fs) == 0) +#endif { #if _WIN32 return ((fs.st_mode & _S_IFDIR) != 0); |