Applied patch from n3s: the check for file extension was broken. Thanks!
This fixes bug #2034 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24930 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6cb51e58bc
commit
2be56e7576
@ -124,8 +124,11 @@ ExpanderRules::MatchingRule(BString &fileName, const char *filetype)
|
||||
int32 length = fileName.Length();
|
||||
for (int32 i = 0; i < count; i++) {
|
||||
ExpanderRule *rule = (ExpanderRule *)fList.ItemAt(i);
|
||||
if ((rule->MimeType().IsValid() && rule->MimeType() == filetype)
|
||||
|| (fileName.FindLast(rule->FilenameExtension()) == (length - rule->FilenameExtension().Length())))
|
||||
if (rule->MimeType().IsValid() && rule->MimeType() == filetype)
|
||||
return rule;
|
||||
int32 extPosition = fileName.FindLast(rule->FilenameExtension());
|
||||
if (extPosition != -1
|
||||
&& extPosition == (length - rule->FilenameExtension().Length()))
|
||||
return rule;
|
||||
}
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user