Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2008-02-24 00:37:08 +0300
committerJunio C Hamano <gitster@pobox.com>2008-02-24 01:22:01 +0300
commit9d561ad324fc8942919981f2c80360e22896989c (patch)
tree564a936c79c317455045e53971abf2237df76bc3 /gitweb
parent923d44aeb7cb6d21eeb459fdc1b58137e37c2b1c (diff)
gitweb: Fix bugs in git_search_grep_body: it's length(), not len()
Use int(<expr>/2) to get integer value for a substring length. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 326e27cf88..e8226b16f4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3792,7 +3792,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);