summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/pages.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 1199a2876..a3a1df325 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -1370,13 +1370,19 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string
tw_h_offset = 0;
if (!TWFunc::Path_Exists(package))
return -1;
+#ifdef USE_MINZIP
if (sysMapFile(package.c_str(), &map) != 0) {
+#else
+ if (!map.MapFile(package)) {
+#endif
LOGERR("Failed to map '%s'\n", package.c_str());
goto error;
}
if (!zip.Open(package.c_str(), &map)) {
LOGERR("Unable to open zip archive '%s'\n", package.c_str());
+#ifdef USE_MINZIP
sysReleaseMap(&map);
+#endif
goto error;
}
ctx.zip = &zip;
@@ -1418,7 +1424,9 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string
if (ctx.zip) {
ctx.zip->Close();
+#ifdef USE_MINZIP
sysReleaseMap(&map);
+#endif
}
return ret;
@@ -1426,7 +1434,9 @@ error:
// Sometimes we get here without a real error
if (ctx.zip) {
ctx.zip->Close();
+#ifdef USE_MINZIP
sysReleaseMap(&map);
+#endif
}
return -1;
}