don't loop forever
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 4 Jun 2008 03:55:00 +0000 (23:55 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 4 Jun 2008 03:55:00 +0000 (23:55 -0400)
IkiWiki/Plugin/search.pm

index 0d4a8f552abb9bf7f38d7e1112e1278308df1353..dd44855bd067185f5fdbe9ecd2d380e45bed8cc2 100644 (file)
@@ -93,7 +93,7 @@ sub filter (@) { #{{{
                my $size=512;
                my ($sample)=substr($toindex, 0, $size);
                my $next=substr($toindex, $size++, 1);
-               while ($next !~ /\s/) {
+               while (defined $next && $next !~ /\s/) {
                        $sample.=$next;
                        $next=substr($toindex, $size++, 1);
                }