Fixed bug in archive.cpp that caused at least one engine (SAGA) not to work

svn-id: r44560
This commit is contained in:
Yotam Barnoy 2009-10-03 20:12:44 +00:00
parent bbb3cc8086
commit 1336b5464b
2 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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.