projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7fc2911
)
avoid warning
author
Joey Hess
<joey@kodama.kitenet.net>
Wed, 4 Jun 2008 03:58:19 +0000
(23:58 -0400)
committer
Joey Hess
<joey@kodama.kitenet.net>
Wed, 4 Jun 2008 03:58:19 +0000
(23:58 -0400)
"substr outside of string"
IkiWiki/Plugin/search.pm
patch
|
blob
|
history
diff --git
a/IkiWiki/Plugin/search.pm
b/IkiWiki/Plugin/search.pm
index 679321ce55065e237a7102c0dc81bca3dc4f2a13..0218987d0f7c51d8dbf2c506f042033bbd16751e 100644
(file)
--- a/
IkiWiki/Plugin/search.pm
+++ b/
IkiWiki/Plugin/search.pm
@@
-92,10
+92,12
@@
sub filter (@) { #{{{
# if it stopped in the middle of a word.
my $size=512;
my ($sample)=substr($toindex, 0, $size);
- my $next=substr($toindex, $size++, 1);
- while (defined $next && $next !~ /\s/) {
- $sample.=$next;
- $next=substr($toindex, $size++, 1);
+ if (length($sample) == $size) {
+ my $next=substr($toindex, $size++, 1);
+ while (defined $next && $next !~ /\s/) {
+ $sample.=$next;
+ $next=substr($toindex, $size++, 1);
+ }
}
$sample=~s/\n/ /g;