summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-02-13 15:00:50 (GMT)
committerBrad King <brad.king@kitware.com>2013-02-13 15:00:50 (GMT)
commitf123367254c4737981af3e0641e5a4f388d0567d (patch)
tree2ecc746842575ca5a2223dbdffea6451e8ab59e9 /Source/cmFileCommand.cxx
parent132450066945d2c7244205df662f3137edfad5bc (diff)
downloadCMake-f123367254c4737981af3e0641e5a4f388d0567d.zip
CMake-f123367254c4737981af3e0641e5a4f388d0567d.tar.gz
CMake-f123367254c4737981af3e0641e5a4f388d0567d.tar.bz2
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.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 0cdbb82..018ce7e 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2409,7 +2409,8 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
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());
}