GUI: Fixed path match problem that caused extra directories to be selected/unselected

This commit is contained in:
Daniel Marjamäki 2012-01-13 06:18:56 +01:00
parent 8754caa36d
commit d8a1a693d5
1 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,12 @@ private:
int matchindex = -1;
for (int i = 0; i < s.size(); ++i) {
if (filepath.startsWith(s[i])) {
// not a real match of paths..
if (s[i].size() < filepath.size() && filepath[s[i].size()] != '/')
continue;
// paths match. the return value is the index for the
// longest match
if (s[i].size() > matchlen)
matchindex = i;
}