summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/fszip.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-16 01:01:55 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-16 01:46:05 +0300
commit24bd6a6d26bab89126db7183bb693779a1742c6d (patch)
tree1a7ae594883562a01abdb2c8070a6585af2780e4 /src/fs/virtfs/fszip.cpp
parent65ef43ab06f3dfb7b87caa3ba8236ea741d59f35 (diff)
downloadmanaplus-24bd6a6d26bab89126db7183bb693779a1742c6d.tar.gz
manaplus-24bd6a6d26bab89126db7183bb693779a1742c6d.tar.bz2
manaplus-24bd6a6d26bab89126db7183bb693779a1742c6d.tar.xz
manaplus-24bd6a6d26bab89126db7183bb693779a1742c6d.zip
Add subdir support into virtfs::exists.
Diffstat (limited to 'src/fs/virtfs/fszip.cpp')
-rw-r--r--src/fs/virtfs/fszip.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp
index eda5dd078..562e0bc80 100644
--- a/src/fs/virtfs/fszip.cpp
+++ b/src/fs/virtfs/fszip.cpp
@@ -118,10 +118,18 @@ namespace FsZip
}
bool exists(FsEntry *restrict const entry,
- const std::string &filename,
- const std::string &dirName)
+ std::string filename,
+ std::string dirName)
{
ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry);
+ std::string subDir = zipEntry->subDir;
+ if (subDir != dirSeparator)
+ {
+ filename = pathJoin(subDir, filename);
+ dirName = pathJoin(subDir, dirName);
+ }
+ if (subDir == dirSeparator)
+ subDir.clear();
FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator,
it2,
zipEntry->mHeaders)