aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYotam Barnoy2009-10-03 20:12:44 +0000
committerYotam Barnoy2009-10-03 20:12:44 +0000
commit1336b5464bb597dca7f81e68c7204be1f1dc6a06 (patch)
tree3dbebdb8391ff515dd199565758c460b04ef0d17
parentbbb3cc808601af2535b888528d9500c224c01ad6 (diff)
downloadscummvm-rg350-1336b5464bb597dca7f81e68c7204be1f1dc6a06.tar.gz
scummvm-rg350-1336b5464bb597dca7f81e68c7204be1f1dc6a06.tar.bz2
scummvm-rg350-1336b5464bb597dca7f81e68c7204be1f1dc6a06.zip
Fixed bug in archive.cpp that caused at least one engine (SAGA) not to work
svn-id: r44560
-rw-r--r--common/archive.cpp17
-rw-r--r--common/archive.h2
2 files changed, 11 insertions, 8 deletions
diff --git a/common/archive.cpp b/common/archive.cpp
index e815b781bf..4f1385f2d8 100644
--- a/common/archive.cpp
+++ b/common/archive.cpp
@@ -123,19 +123,22 @@ void SearchSet::addDirectory(const String &name, const FSNode &dir, int priority
add(name, new FSDirectory(dir, depth, flat), priority);
}
-void SearchSet::addSubDirectoriesMatching(const FSNode &directory, String pattern, bool ignoreCase, int priority) {
+void SearchSet::addSubDirectoriesMatching(const FSNode &directory, String origPattern, bool ignoreCase, int priority) {
FSList subDirs;
if (!directory.getChildren(subDirs))
return;
- String nextPattern;
- String::const_iterator sep = Common::find(pattern.begin(), pattern.end(), '/');
- if (sep != pattern.end()) {
- pattern = String(pattern.begin(), sep);
+ String nextPattern, pattern;
+ String::const_iterator sep = Common::find(origPattern.begin(), origPattern.end(), '/');
+ if (sep != origPattern.end()) {
+ pattern = String(origPattern.begin(), sep);
++sep;
- if (sep != pattern.end())
- nextPattern = String(sep, pattern.end());
+ if (sep != origPattern.end())
+ nextPattern = String(sep, origPattern.end());
+ }
+ else {
+ pattern = origPattern;
}
// TODO: The code we have for displaying all matches, which vary only in case, might
diff --git a/common/archive.h b/common/archive.h
index 39fce497c4..1cc983f77b 100644
--- a/common/archive.h
+++ b/common/archive.h
@@ -212,7 +212,7 @@ public:
*
* @see Common::matchString
*/
- void addSubDirectoriesMatching(const FSNode &directory, String pattern, bool ignoreCase, int priority = 0);
+ void addSubDirectoriesMatching(const FSNode &directory, String origPattern, bool ignoreCase, int priority = 0);
/**
* Remove an archive from the searchable set.