]> Sergey Matveev's repositories - public-inbox.git/commitdiff
pop3: fix off-by-one error when handling `EXPIRE 0'
authorEric Wong <e@80x24.org>
Fri, 12 Aug 2022 21:30:37 +0000 (21:30 +0000)
committerEric Wong <e@80x24.org>
Fri, 12 Aug 2022 21:32:07 +0000 (21:32 +0000)
mark_dele already works on the cache offset, so there's no need
to make further adjustments to the offset (as we do with POP3
sequence numbers).

lib/PublicInbox/POP3.pm

index bd7dfc6583890901974febd0ed36d536e3403e4c..19fcc434b3483b73a8f7be0327fa7f074ce03e6a 100644 (file)
@@ -233,7 +233,7 @@ sub retr_cb { # called by git->cat_async via ibx_async_cat
                my @tmp = split(/^/m, $bdy);
                $hdr .= join('', splice(@tmp, 0, $top_nr));
        } elsif (exists $self->{expire}) {
-               $self->{expire} .= pack('S', $off + 1);
+               $self->{expire} .= pack('S', $off);
        }
        $$bref =~ s/^\./../gms;
        $$bref .= substr($$bref, -2, 2) eq "\r\n" ? ".\r\n" : "\r\n.\r\n";