From 8efcc3cf26b80ca0451da4c30113b3610f685467 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 16 Dec 2014 03:46:31 +0200 Subject: ZVISION: Bugfix for addDir() - fixes the Nemesis subtitle patch --- engines/zvision/file/search_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/zvision/file/search_manager.cpp') diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp index 752b52b01f..1a6a96ec6d 100644 --- a/engines/zvision/file/search_manager.cpp +++ b/engines/zvision/file/search_manager.cpp @@ -38,7 +38,10 @@ SearchManager::SearchManager(const Common::String &rootPath, int depth) { listDirRecursive(_dirList, fsNode, depth); - for (Common::List::iterator it = _dirList.begin(); it != _dirList.end();) + for (Common::List::iterator it = _dirList.begin(); it != _dirList.end();) { + if ((*it).hasSuffix("\\") || (*it).hasSuffix("/")) + (*it).deleteLastChar(); + if (it->size() == _root.size()) it = _dirList.erase(it); else if (it->size() > _root.size()) { @@ -46,6 +49,7 @@ SearchManager::SearchManager(const Common::String &rootPath, int depth) { it++; } else it++; + } } SearchManager::~SearchManager() { -- cgit v1.2.3