summaryrefslogtreecommitdiffstats
path: root/Source/cmArchiveWrite.cxx
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2012-01-10 22:19:41 (GMT)
committerBrad King <brad.king@kitware.com>2012-01-13 18:48:14 (GMT)
commit768cf9183174e11c36c431d80e95ced2f5f9d2ad (patch)
treefeaca5c83785c2ca1722d8634af9e77d0efb31ec /Source/cmArchiveWrite.cxx
parent0020fc45171c2d8b954492ea76c3b3940ebf53f3 (diff)
downloadCMake-768cf9183174e11c36c431d80e95ced2f5f9d2ad.zip
CMake-768cf9183174e11c36c431d80e95ced2f5f9d2ad.tar.gz
CMake-768cf9183174e11c36c431d80e95ced2f5f9d2ad.tar.bz2
Do not add the content of a file if it's a symlink.
This wasn't necessary for TAR-like (TGZ, TBZ2, etc...) archive because for those the size was 0. Either there is an error in upstream libarchive concerning the size or we should not rely on size of the entry for adding content.
Diffstat (limited to 'Source/cmArchiveWrite.cxx')
-rw-r--r--Source/cmArchiveWrite.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index eab8a59..dc6b749 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -247,10 +247,14 @@ bool cmArchiveWrite::AddFile(const char* file,
return false;
}
- // Content.
- if(size_t size = static_cast<size_t>(archive_entry_size(e)))
+ // do not copy content of symlink
+ if (!archive_entry_symlink(e))
{
- return this->AddData(file, size);
+ // Content.
+ if(size_t size = static_cast<size_t>(archive_entry_size(e)))
+ {
+ return this->AddData(file, size);
+ }
}
return true;
}