diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2020-01-31 17:40:42 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2020-01-31 21:32:04 (GMT) |
commit | 34413cbf3f578971b66da3fbf24539656d850b33 (patch) | |
tree | 39b6d1d233666a3e2df71ccb66fc7144ae9fef23 /Source/cmArchiveWrite.cxx | |
parent | 371e9e48a4186f41354938b0b805a351857c78a0 (diff) | |
download | CMake-34413cbf3f578971b66da3fbf24539656d850b33.zip CMake-34413cbf3f578971b66da3fbf24539656d850b33.tar.gz CMake-34413cbf3f578971b66da3fbf24539656d850b33.tar.bz2 |
cmArchiveWrite: Remove ./ suffix from 7zip archives
Fixes: #20297
Diffstat (limited to 'Source/cmArchiveWrite.cxx')
-rw-r--r-- | Source/cmArchiveWrite.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index f8d1aa7..d29b2ac 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -200,7 +200,8 @@ bool cmArchiveWrite::Add(std::string path, size_t skip, const char* prefix, bool cmArchiveWrite::AddPath(const char* path, size_t skip, const char* prefix, bool recursive) { - if (strcmp(path, ".") != 0 || this->Format != "zip") { + if (strcmp(path, ".") != 0 || + (this->Format != "zip" && this->Format != "7zip")) { if (!this->AddFile(path, skip, prefix)) { return false; } @@ -212,7 +213,7 @@ bool cmArchiveWrite::AddPath(const char* path, size_t skip, const char* prefix, cmsys::Directory d; if (d.Load(path)) { std::string next = cmStrCat(path, '/'); - if (next == "./" && this->Format == "zip") { + if (next == "./" && (this->Format == "zip" || this->Format == "7zip")) { next.clear(); } std::string::size_type end = next.size(); |