diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/file/search_manager.cpp | 11 | ||||
-rw-r--r-- | engines/zvision/file/search_manager.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp index aecfff5208..80792b07d8 100644 --- a/engines/zvision/file/search_manager.cpp +++ b/engines/zvision/file/search_manager.cpp @@ -134,9 +134,10 @@ bool SearchManager::hasFile(const Common::String &name) { return false; } -void SearchManager::loadZix(const Common::String &name) { +bool SearchManager::loadZix(const Common::String &name) { Common::File file; - file.open(name); + if (!file.open(name)) + return false; Common::String line; @@ -147,7 +148,7 @@ void SearchManager::loadZix(const Common::String &name) { } if (file.eos()) - return; + error("Corrupt ZIX file: %s", name.c_str()); Common::Array<Common::Archive *> archives; @@ -189,7 +190,7 @@ void SearchManager::loadZix(const Common::String &name) { } if (file.eos()) - return; + error("Corrupt ZIX file: %s", name.c_str()); while (!file.eos()) { line = file.readLine(); @@ -202,6 +203,8 @@ void SearchManager::loadZix(const Common::String &name) { } } } + + return true; } void SearchManager::addDir(const Common::String &name) { diff --git a/engines/zvision/file/search_manager.h b/engines/zvision/file/search_manager.h index 43e7ff4d14..0d0ab14d31 100644 --- a/engines/zvision/file/search_manager.h +++ b/engines/zvision/file/search_manager.h @@ -44,7 +44,7 @@ public: bool openFile(Common::File &file, const Common::String &name); bool hasFile(const Common::String &name); - void loadZix(const Common::String &name); + bool loadZix(const Common::String &name); struct Node { Common::String name; |