diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6d53c8b956..24c2fe2a1b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1407,6 +1407,7 @@ sub git_print_log ($;%) {
foreach my $line (@$log) {
if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
$signoff = 1;
+ $empty = 0;
if (! $opts{'-remove_signoff'}) {
print "" . esc_html($line) . "
\n";
next;