Regexps consume more CPU cycles and memory, and aren't
necessary here since we just converted the entire buffer
to CRLF.
# these can momentarily double the memory consumption :<
$$msg =~ s/^\./../smg;
$$msg =~ s/(?<!\r)\n/\r\n/sg; # Alpine barfs without this
# 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);
}
$self->msg_more($$msg);
}