diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-16 02:41:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-16 02:41:29 +0300 |
commit | cfb75b015a4e70843e571ce599e11bf2990abc1b (patch) | |
tree | 6ad173a6e0343364fc5ee747171f652b49ff4cce /src/fs/virtfs/fszip.cpp | |
parent | 24bd6a6d26bab89126db7183bb693779a1742c6d (diff) | |
download | ManaVerse-cfb75b015a4e70843e571ce599e11bf2990abc1b.tar.gz ManaVerse-cfb75b015a4e70843e571ce599e11bf2990abc1b.tar.bz2 ManaVerse-cfb75b015a4e70843e571ce599e11bf2990abc1b.tar.xz ManaVerse-cfb75b015a4e70843e571ce599e11bf2990abc1b.zip |
Add subdir support into VirtFs::getRealDir.
Diffstat (limited to 'src/fs/virtfs/fszip.cpp')
-rw-r--r-- | src/fs/virtfs/fszip.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp index 562e0bc80..30f3fbd8e 100644 --- a/src/fs/virtfs/fszip.cpp +++ b/src/fs/virtfs/fszip.cpp @@ -89,11 +89,17 @@ namespace FsZip } bool getRealDir(FsEntry *restrict const entry, - const std::string &filename, - const std::string &dirName, + std::string filename, + std::string dirName, std::string &realDir) { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); + std::string subDir = zipEntry->subDir; + if (subDir != dirSeparator) + { + filename = pathJoin(subDir, filename); + dirName = pathJoin(subDir, dirName); + } FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator, it2, zipEntry->mHeaders) @@ -128,8 +134,6 @@ namespace FsZip filename = pathJoin(subDir, filename); dirName = pathJoin(subDir, dirName); } - if (subDir == dirSeparator) - subDir.clear(); FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator, it2, zipEntry->mHeaders) |