diff --git a/src/frontend/qt_sdl/ArchiveUtil.cpp b/src/frontend/qt_sdl/ArchiveUtil.cpp index 6457b4fe..98851917 100644 --- a/src/frontend/qt_sdl/ArchiveUtil.cpp +++ b/src/frontend/qt_sdl/ArchiveUtil.cpp @@ -87,8 +87,9 @@ QVector ExtractFileFromArchive(const char* path, const char* wantedFile return QVector {"Err", archive_error_string(a)}; } - const char* fileToWrite = archive_entry_pathname(entry); - std::ofstream(fileToWrite, std::ofstream::binary).write((char*)archiveBuffer.get(), bytesToWrite); + QString fileToWrite = QFileInfo(path).absolutePath() + "/" + QFileInfo(dirToWrite).baseName() + "/" + archive_entry_pathname(entry); + + std::ofstream(fileToWrite.toUtf8().constData(), std::ofstream::binary).write((char*)archiveBuffer.get(), bytesToWrite); archiveBuffer.reset(nullptr); archive_read_close(a);