]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTP.pm
nntp: regexp always consumes rbuf if "\n" exists
[public-inbox.git] / lib / PublicInbox / NNTP.pm
index 41f1e9c1ed9e6a5321b1ead30853419b43fad644..c04968529854067ef4152f62f38588bd82314b1a 100644 (file)
@@ -995,7 +995,7 @@ sub event_step {
                my $off = bytes::length($$rbuf);
                $r = $self->do_read($rbuf, LINE_MAX, $off) or return;
        }
-       while ($r > 0 && $$rbuf =~ s/\A[ \t\r\n]*([^\r\n]*)\r?\n//) {
+       while ($r > 0 && $$rbuf =~ s/\A[ \t]*([^\n]*?)\r?\n//) {
                my $line = $1;
                return $self->close if $line =~ /[[:cntrl:]]/s;
                my $t0 = now();