mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 22:10:32 +00:00
BUG: When removing directory, use lstat instead of stat to make sure that symlinks are treated as files and not as directories
This commit is contained in:
parent
2dc914c839
commit
219bcf25ba
@ -29,7 +29,9 @@ bool cmCTestEmptyBinaryDirectoryCommand::InitialPass(
|
||||
|
||||
if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) )
|
||||
{
|
||||
this->SetError("problem removing the binary directory");
|
||||
cmOStringStream ostr;
|
||||
ostr << "problem removing the binary directory: " << args[0].c_str();
|
||||
this->SetError(ostr.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user