aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/ArchiveFileOperator.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2023-03-31 21:27:08 +0000
committerGitHub <[email protected]>2023-03-31 21:27:08 +0000
commit3cb863592a548edc074dde045493e0f83e5d694a (patch)
tree242534c257e723f49080428db22118c75706e233 /src/core/function/ArchiveFileOperator.cpp
parentMerge pull request #91 from saturneric/dev/2.0.10/main (diff)
parentfeat: add project security document (diff)
downloadGpgFrontend-2.1.0.tar.gz
GpgFrontend-2.1.0.zip
Merge pull request #93 from saturneric/dev/2.0.10/mainv2.1.0
Develop 2.1.0.2
Diffstat (limited to '')
-rw-r--r--src/core/function/ArchiveFileOperator.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/core/function/ArchiveFileOperator.cpp b/src/core/function/ArchiveFileOperator.cpp
index 04c9326f..8aad0500 100644
--- a/src/core/function/ArchiveFileOperator.cpp
+++ b/src/core/function/ArchiveFileOperator.cpp
@@ -136,8 +136,6 @@ void GpgFrontend::ArchiveFileOperator::CreateArchive(
}
for (;;) {
- bool needcr = false;
-
entry = archive_entry_new();
r = archive_read_next_header2(disk, entry);
@@ -149,15 +147,6 @@ void GpgFrontend::ArchiveFileOperator::CreateArchive(
}
archive_read_disk_descend(disk);
-#ifdef WINDOWS
- auto entry_path =
- QString::fromStdWString(std::wstring(archive_entry_pathname_w(entry)))
- .toUtf8()
- .toStdString();
-#else
- auto entry_path = std::string(archive_entry_pathname_utf8(entry));
-#endif
-
SPDLOG_DEBUG("Adding: {} size: {} bytes: {} file type: {}",
archive_entry_pathname_utf8(entry),
archive_entry_size(entry), archive_entry_filetype(entry));
@@ -201,7 +190,6 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive(
struct archive *a;
struct archive *ext;
struct archive_entry *entry;
- int r;
a = archive_read_new();
ext = archive_write_disk_new();
@@ -241,8 +229,9 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive(
archive_error_string(a));
throw std::runtime_error("archive_read_open_filename() failed");
}
+
for (;;) {
- r = archive_read_next_header(a, &entry);
+ int r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF) break;
if (r != ARCHIVE_OK) {
SPDLOG_ERROR("archive_read_next_header() failed: {}",