{"thread":{"id":"12276","subject":"[PATCH] gitweb: Fix bugs in git_search_grep_body: it's length(), not len()","startedAt":"2008-02-23T21:37:08Z","lastAt":"2008-02-23T21:37:08Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69714","messageId":"20080223213449.16213.42233.stgit@localhost.localdomain","threadId":"12276","inReplyTo":null,"subject":"[PATCH] gitweb: Fix bugs in git_search_grep_body: it's length(), not len()","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-02-23T21:37:08Z","receivedAt":"2008-02-23T21:37:08Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\nUse int(<expr>/2) to get integer value for a substring length.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nI'm very very sorry. I though I have tested this, but somehow it\nslipped through; most probably I have tested older version.\n\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 326e27c..e8226b1 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3792,7 +3792,7 @@ sub git_search_grep_body {\n \t\t\tif ($line =~ m/^(.*)($search_regexp)(.*)$/i) {\n \t\t\t\tmy ($lead, $match, $trail) = ($1, $2, $3);\n \t\t\t\t$match = chop_str($match, 70, 5);       # in case match is very long\n-\t\t\t\tmy $contextlen = (80 - len($match))/2;  # is left for the remainder\n+\t\t\t\tmy $contextlen = int((80 - length($match))/2); # for the remainder\n \t\t\t\t$contextlen = 30 if ($contextlen > 30); # but not too much\n \t\t\t\t$lead  = chop_str($lead,  $contextlen, 10);\n \t\t\t\t$trail = chop_str($trail, $contextlen, 10);\n"}]}