From 3ba723d79ad10420666cc7e9e1fc1537c59f6be5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 3 Jun 2008 23:55:00 -0400 Subject: [PATCH] don't loop forever --- IkiWiki/Plugin/search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 0d4a8f552..dd44855bd 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -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); } -- 2.26.2