summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/fszip.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-16 02:41:29 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-16 02:41:29 +0300
commitcfb75b015a4e70843e571ce599e11bf2990abc1b (patch)
tree6ad173a6e0343364fc5ee747171f652b49ff4cce /src/fs/virtfs/fszip.cpp
parent24bd6a6d26bab89126db7183bb693779a1742c6d (diff)
downloadmanaverse-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.cpp12
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)