diff options
author | Brad King <brad.king@kitware.com> | 2013-02-13 15:00:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-13 15:00:50 (GMT) |
commit | f123367254c4737981af3e0641e5a4f388d0567d (patch) | |
tree | 2ecc746842575ca5a2223dbdffea6451e8ab59e9 /Source/cmFileCommand.cxx | |
parent | 132450066945d2c7244205df662f3137edfad5bc (diff) | |
download | CMake-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.cxx | 3 |
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()); } |