Mimetype optimization

Olivier Goffart ogoffart at bepointbe.be
Tue Apr 22 23:01:05 CEST 2008


Le mardi 22 avril 2008, Jakub Stachowski a écrit :
> Index: kmimetypefactory.cpp
> ===================================================================
> --- kmimetypefactory.cpp        (wersja 799070)
> +++ kmimetypefactory.cpp        (kopia robocza)
> @@ -190,8 +190,10 @@
>      int len = filename.length();
>
>      // Patterns like "*~", "*.extension"
> -    if (pattern[0] == '*' && len + 1 >= pattern_len &&
> pattern.indexOf('[') == -1) +    if (pattern[0] == '*'  &&
> pattern.indexOf('[') == -1)
>      {
> +        if ( len + 1 < pattern_len ) return false;
> +

What about patern like *foo*bar*
this will not match "foobar" anymore.
I think you should search for '*' in the pattern

(oh, and is there some escaping in regexp? such as "*foo\?\?" )

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20080422/8e4858f8/attachment.pgp 


More information about the Kde-optimize mailing list