]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTP.pm
nntp: use substr to check for trailing CRLF
[public-inbox.git] / lib / PublicInbox / NNTP.pm
index 8ad7adc1fd0a3ca49a5635dc19c8b4c7c95b6c01..b223eb07d417bad27115bcf5411090f4e9ab257c 100644 (file)
@@ -502,7 +502,7 @@ sub msg_body_write ($$) {
        # these can momentarily double the memory consumption :<
        $$msg =~ s/^\./../smg;
        $$msg =~ s/(?<!\r)\n/\r\n/sg; # Alpine barfs without this
-       $$msg .= "\r\n" unless $$msg =~ /\r\n\z/s;
+       $$msg .= "\r\n" unless substr($$msg, -2, 2) eq "\r\n";
        $self->msg_more($$msg);
 }