diff options
author | Brad King <brad.king@kitware.com> | 2020-01-28 16:03:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-28 16:04:30 (GMT) |
commit | ee5edfbda22262a67f630bd83d5494c2ba0d7f44 (patch) | |
tree | bc447a55e5693db8788d1ad4720a83ff36cd1b4d | |
parent | cb8bd146c985883f05f20d11aa57602b86fcc83a (diff) | |
parent | 830a7d88032822a7a1601735ac013999fff53b9a (diff) | |
download | CMake-ee5edfbda22262a67f630bd83d5494c2ba0d7f44.zip CMake-ee5edfbda22262a67f630bd83d5494c2ba0d7f44.tar.gz CMake-ee5edfbda22262a67f630bd83d5494c2ba0d7f44.tar.bz2 |
Merge topic 'dot-dir'
830a7d8803 cmArchiveWrite: Remove ./ suffix from zip archives
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4288
-rw-r--r-- | Source/cmArchiveWrite.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index e5eea79..f8d1aa7 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -200,8 +200,10 @@ 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 (!this->AddFile(path, skip, prefix)) { - return false; + if (strcmp(path, ".") != 0 || this->Format != "zip") { + if (!this->AddFile(path, skip, prefix)) { + return false; + } } if ((!cmSystemTools::FileIsDirectory(path) || !recursive) || cmSystemTools::FileIsSymlink(path)) { @@ -210,6 +212,9 @@ 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") { + next.clear(); + } std::string::size_type end = next.size(); unsigned long n = d.GetNumberOfFiles(); for (unsigned long i = 0; i < n; ++i) { |