summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/fszip.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-16 17:50:47 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-16 17:50:47 +0300
commit3cf47056f239f1096590c27c1d401904a54f84fc (patch)
tree6e2dc17b22f9afb8079698b38d7dd12ed971b9ad /src/fs/virtfs/fszip.cpp
parent5f66478632d388bfae78cbbb938a42eac3956db2 (diff)
downloadplus-3cf47056f239f1096590c27c1d401904a54f84fc.tar.gz
plus-3cf47056f239f1096590c27c1d401904a54f84fc.tar.bz2
plus-3cf47056f239f1096590c27c1d401904a54f84fc.tar.xz
plus-3cf47056f239f1096590c27c1d401904a54f84fc.zip
Add subdir support in VirtFs::loadFile.
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 f2f16bcbb..91d323cc1 100644
--- a/src/fs/virtfs/fszip.cpp
+++ b/src/fs/virtfs/fszip.cpp
@@ -658,10 +658,13 @@ namespace FsZip
}
const char *loadFile(FsEntry *restrict const entry,
- const std::string &restrict filename,
+ std::string filename,
int &restrict fileSize)
{
ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry);
+ const std::string subDir = zipEntry->subDir;
+ if (subDir != dirSeparator)
+ filename = pathJoin(subDir, filename);
FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator,
it2,
zipEntry->mHeaders)