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:
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 3 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1c54301582..588b87d234 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1740,6 +1740,9 @@ sub esc_html_hl_regions {
for my $s (@sel) {
my ($begin, $end) = @$s;
+ # Don't create empty <span> elements.
+ next if $end <= $begin;
+
my $escaped = esc_html(substr($str, $begin, $end - $begin));
$out .= esc_html(substr($str, $pos, $begin - $pos))