X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=fa96cca337d87f9113425a209c5b78aafa2b6dfa;hp=64e73234f9ee2b17ca4efc4d5094d402426ee6d8;hb=4eee5af6011cc8cdefb66c9729952c7eff5c0b0b;hpb=a80fd0c8e19464f95dec5a5c2d128a1614f51ee5
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 64e73234..fa96cca3 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -142,6 +142,9 @@ $info
$se_url
$link
+
+ Be sure your reply has a Subject: header at the top and a blank line
+ before the message body.
EOF
}
@@ -260,7 +263,6 @@ sub eml_entry {
} elsif ($mapping) {
my $nested = 'nested';
my $flat = 'flat';
- my $end = '';
if ($ctx->{flat}) {
$hr = 1;
$flat = "$flat";
@@ -533,6 +535,7 @@ sub attach_link ($$$$;$) {
my $nl = $idx eq '1' ? '' : "\n"; # like join("\n", ...)
my $size = length($part->body);
+ delete $part->{bdy}; # save memory
# hide attributes normally, unless we want to aid users in
# spotting MUA problems:
@@ -585,7 +588,7 @@ sub add_text_body { # callback for each_part
# makes no difference to browsers, and don't screw up filename
# link generation in diffs with the extra '%0D'
- $s =~ s/\r\n/\n/sg;
+ $s =~ s/\r+\n/\n/sg;
# will be escaped to `•' in HTML
obfuscate_addrs($ibx, $s, "\x{2022}") if $ibx->{obfuscate};
@@ -632,6 +635,7 @@ sub add_text_body { # callback for each_part
attach_link($ctx, $ct, $p, $fn, $err);
$$rv .= "\n";
}
+ delete $part->{bdy}; # save memory
foreach my $cur (@sections) {
if ($cur =~ /\A>/) {
# we use a here to allow users to specify
@@ -976,7 +980,7 @@ sub skel_dump { # walk_thread callback
$$skel .= delete($ctx->{sl_note}) || '';
}
- my $f = ascii_html($smsg->{from_name});
+ my $f = ascii_html(delete $smsg->{from_name});
my $obfs_ibx = $ctx->{-obfs_ibx};
obfuscate_addrs($obfs_ibx, $f) if $obfs_ibx;
@@ -1071,10 +1075,10 @@ sub _skel_ghost {
}
sub sort_ds {
- [ sort {
+ @{$_[0]} = sort {
(eval { $a->topmost->{ds} } || 0) <=>
(eval { $b->topmost->{ds} } || 0)
- } @{$_[0]} ];
+ } @{$_[0]};
}
# accumulate recent topics if search is supported