file: Do not remove symlinked directories recursively (#10538)
If a symlink points at a directory the symlink should be removed but not the content of the directory.
This commit is contained in:
parent
1324500669
commit
f123367254
|
@ -2409,7 +2409,8 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
|
||||||
fileName += "/" + *i;
|
fileName += "/" + *i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cmSystemTools::FileIsDirectory(fileName.c_str()) && recurse)
|
if(cmSystemTools::FileIsDirectory(fileName.c_str()) &&
|
||||||
|
!cmSystemTools::FileIsSymlink(fileName.c_str()) && recurse)
|
||||||
{
|
{
|
||||||
cmSystemTools::RemoveADirectory(fileName.c_str());
|
cmSystemTools::RemoveADirectory(fileName.c_str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue