summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b00ac8c)
raw | patch | inline | side by side (parent: b00ac8c)
author | Jakub Narebski <jnareb@gmail.com> | |
Sun, 2 Mar 2008 15:57:14 +0000 (16:57 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 2 Mar 2008 23:26:31 +0000 (15:26 -0800) |
Due to greediness of a pattern, gitweb used to mark (show) last match
in line, if there are more than one match in line. Now it shows first.
Showing all matches in a line would require further work.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
in line, if there are more than one match in line. Now it shows first.
Showing all matches in a line would require further work.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 20dc5d59c22291737a2a8a7de6acce489db315bb..922dee98b91132b4a4aca37a382ae7c9711aa2e8 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
chop_and_escape_str($co{'title'}, 50) . "<br/>");
my $comment = $co{'comment'};
foreach my $line (@$comment) {
- if ($line =~ m/^(.*)($search_regexp)(.*)$/i) {
+ if ($line =~ m/^(.*?)($search_regexp)(.*)$/i) {
my ($lead, $match, $trail) = ($1, $2, $3);
$match = chop_str($match, 70, 5, 'center');
my $contextlen = int((80 - length($match))/2);