1
0
Fork 0

Fix #12041, 0c81579: Tarball extraction failing due to incorrect filename

pull/12044/head
glx22 2024-02-09 15:50:20 +01:00
parent 9b323b4ef9
commit 80745b6422
1 changed files with 4 additions and 1 deletions

View File

@ -700,7 +700,10 @@ bool ExtractTar(const std::string &tar_filename, Subdirectory subdir)
for (auto &it2 : _tar_filelist[subdir]) {
if (tar_filename != it2.second.tar_filename) continue;
filename.replace(p + 1, std::string::npos, it2.first);
/* it2.first is tarball + PATHSEPCHAR + name. */
std::string_view name = it2.first;
name.remove_prefix(name.find_first_of(PATHSEPCHAR) + 1);
filename.replace(p + 1, std::string::npos, name);
Debug(misc, 9, " extracting {}", filename);