]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
view: remove all CR before LF
[public-inbox.git] / lib / PublicInbox / View.pm
index a6944b80bbed08ca41c702c234b1010571b1e5ac..ca02ae057f2343ad4d66f9202a8563ccfc46c6ac 100644 (file)
@@ -586,7 +586,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};
@@ -978,7 +978,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;
 
@@ -1073,10 +1073,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