]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
glob2re: return a precompiled, anchored case-insensitive regex
authorSimon McVittie <smcv@debian.org>
Fri, 19 Nov 2010 23:59:04 +0000 (23:59 +0000)
committerSimon McVittie <smcv@debian.org>
Fri, 19 Nov 2010 23:59:04 +0000 (23:59 +0000)
In practice every use of glob2re uses it like that.

IkiWiki.pm

index 57e23fda8c8727d4f5d6d0a9f3022e4e88a77e06..bb7d46ccfb63f8de96a4246b49de1dea67d9b8ea 100644 (file)
@@ -2388,7 +2388,7 @@ sub glob2re ($) {
        my $re=quotemeta(shift);
        $re=~s/\\\*/.*/g;
        $re=~s/\\\?/./g;
-       return $re;
+       return qr/^$re$/i;
 }
 
 package IkiWiki::FailReason;