From 3d767c19ca58c685fe0dfa68fc1bfa24b9a22092 Mon Sep 17 00:00:00 2001 From: fukachan Date: Mon, 12 Feb 2001 15:18:14 +0000 Subject: _print_*(): check $len, exit if $len == 0 (which means $buf not contain even "\n") remove $pe which is not used. --- fml/lib/MailingList/Messages.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fml/lib/MailingList/Messages.pm b/fml/lib/MailingList/Messages.pm index 1469972e..a67bb670 100644 --- a/fml/lib/MailingList/Messages.pm +++ b/fml/lib/MailingList/Messages.pm @@ -400,7 +400,7 @@ sub _print_messsage_on_memory } # 2. print content body: write each line in buffer - my ($p, $len, $buf, $pbuf, $pe); + my ($p, $len, $buf, $pbuf); SMTP_IO: while (1) { $p = index($$r_body, "\n", $pp); @@ -408,9 +408,11 @@ sub _print_messsage_on_memory $len = $p - $pp + 1; $len = ($p < 0 ? ($maxlen - $pp) : $len); - $pe = $pp + $len; $buf = substr($$r_body, $pp, $len); + # do nothing, get away from here + last SMTP_IO if $len == 0; + unless (defined $raw_print_mode) { # fix \n -> \r\n in the end of the line if ($buf !~ /\r\n$/) { $buf =~ s/\n$/\r\n/;} -- cgit v1.2.1