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:
Brad King 2013-02-13 10:00:50 -05:00
parent 1324500669
commit f123367254
1 changed files with 2 additions and 1 deletions

View File

@ -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());
} }