summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/fszip.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-16 17:32:31 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-16 17:32:31 +0300
commit5f66478632d388bfae78cbbb938a42eac3956db2 (patch)
tree106a737e821a8d3c79bf0ae172c66c18305cf990 /src/fs/virtfs/fszip.cpp
parent0a849f982988cbd7c7afdedccb210bada702238b (diff)
downloadplus-5f66478632d388bfae78cbbb938a42eac3956db2.tar.gz
plus-5f66478632d388bfae78cbbb938a42eac3956db2.tar.bz2
plus-5f66478632d388bfae78cbbb938a42eac3956db2.tar.xz
plus-5f66478632d388bfae78cbbb938a42eac3956db2.zip
Add subdir support in VirtFs::openRead.
Diffstat (limited to 'src/fs/virtfs/fszip.cpp')
-rw-r--r--src/fs/virtfs/fszip.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp
index e7fab595f..f2f16bcbb 100644
--- a/src/fs/virtfs/fszip.cpp
+++ b/src/fs/virtfs/fszip.cpp
@@ -526,9 +526,12 @@ namespace FsZip
}
File *openRead(FsEntry *restrict const entry,
- const std::string &filename)
+ std::string filename)
{
ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry);
+ std::string subDir = zipEntry->subDir;
+ if (subDir != dirSeparator)
+ filename = pathJoin(subDir, filename);
FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator,
it2,
zipEntry->mHeaders)