Skip to content

Commit 487cc03

Browse files
fix: Simplify header name assignment in FileTask
- Removed the addition of the base directory name when calculating the header name. - Directly set the header name to the relative path, streamlining the logic for path handling.
1 parent 1f8a8b7 commit 487cc03

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

3rdparty/pzip/src/file_task.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ Error FileTask::reset(const fs::path& filePath, const fs::path& relativeTo) {
111111
// 如果无法计算相对路径,使用文件名
112112
header.name = path.filename().string();
113113
} else {
114-
// 加上基础目录名
115-
fs::path baseName = relativeTo.filename();
116-
header.name = utils::toZipPath(baseName / relPath);
114+
header.name = utils::toZipPath(relPath);
117115
}
118116
} else {
119117
header.name = utils::toZipPath(path.filename());

0 commit comments

Comments
 (0)