From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B10D11F54E for ; Fri, 12 Aug 2022 21:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1660339837; bh=aZES0LaQHK9gltqWJBmQ/JKqacL7g9M1zdU9EeCy6CA=; h=From:To:Subject:Date:From; b=Zf/tDMcZlVia09e2Oq04zJTwSAiLcVsAgw/VLMxB4M3SIRnOvpXwsCMSGt7qR8PI4 alS1SaVfi/pSzyYzB456X7o2ja+nkYYpVNX9NFrHxtwANDmBp1utQU7W/OxBF9TWEM q7eZ1djPP+BcuBwEPN6Ph/2KAwSvRCbnn51GWJ6Q= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] pop3: fix off-by-one error when handling `EXPIRE 0' Date: Fri, 12 Aug 2022 21:30:37 +0000 Message-Id: <20220812213037.12963-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/POP3.pm b/lib/PublicInbox/POP3.pm index 82df257c..63299869 100644 --- a/lib/PublicInbox/POP3.pm +++ b/lib/PublicInbox/POP3.pm @@ -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";