X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FViewDiff.pm;h=5d391a13e0e0b869cac074761e7f716207b643cc;hp=d22c80b97b4871a00dba47f3e8b055bd1659ab06;hb=1a02e2d367b71eca9fc8093ce83fcae50873003d;hpb=fc92ce8845ac5f09939722537624fa48441f7c0b diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index d22c80b9..5d391a13 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -202,6 +202,17 @@ sub flush_diff ($$$) { $dctx = diff_header($dst, \$x, $ctx, \@top); } elsif ($dctx) { my $after = ''; + + # Quiet "Complex regular subexpression recursion limit" + # warning. Perl will truncate matches upon hitting + # that limit, giving us more (and shorter) scalars than + # would be ideal, but otherwise it's harmless. + # + # We could replace the `+' metacharacter with `{1,100}' + # to limit the matches ourselves to 100, but we can + # let Perl do it for us, quietly. + no warnings 'regexp'; + for my $s (split(/((?:(?:^\+[^\n]*\n)+)| (?:(?:^-[^\n]*\n)+)| (?:^@@ [^\n]+\n))/xsm, $x)) {