X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/d152df4cbbcc62def4367c4ba74af40a98e662dd6bb0503768198e247d692f50..24df73ae2b4b2119368b3ecb85ba96632e36db3d48f7161f62e417734b80ecd6:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 6cd61ca..3bc35cc 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -3793,7 +3793,7 @@ sub git_search_grep_body { if ($line =~ m/^(.*)($search_regexp)(.*)$/i) { my ($lead, $match, $trail) = ($1, $2, $3); $match = chop_str($match, 70, 5); # in case match is very long - my $contextlen = (80 - len($match))/2; # is left for the remainder + my $contextlen = int((80 - length($match))/2); # for the remainder $contextlen = 30 if ($contextlen > 30); # but not too much $lead = chop_str($lead, $contextlen, 10); $trail = chop_str($trail, $contextlen, 10);