GNU bug report logs - #45650
28.0.50; nnmaildir discards line count

Previous Next

Packages: emacs, gnus;

Reported by: Justus-dev <at> Piater.name

Date: Mon, 4 Jan 2021 08:39:02 UTC

Severity: normal

Tags: fixed

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 45650 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Justus-dev <at> Piater.name
Cc: 45650 <at> debbugs.gnu.org
Subject: Re: bug#45650: 28.0.50; nnmaildir discards line count
Date: Mon, 04 Jan 2021 10:44:31 +0100
Justus-dev <at> Piater.name writes:

> This code assumes that if no Lines: header is found, mail-header-lines
> returns 0.  However, mail-header-lines returns -1 in this case, causing
> the correctly-counted number of lines in nov-mid to be overwritten with
> -1.
>
> Replacing (zerop field) by (<= field 0) fixes it.
>
> While I think this is indeed a correct immediate fix,

That's a very confusing function, but this does indeed seem to be the
correct fix here, and I've now done as you suggested in Emacs 28.

> this function should be refactored:
>
> - Why count the number of lines in the message only to discard the
>   result if a Lines: header is found afterwards? (Well, fixing this
>   won't have much impact: Of the 161594 messages in my nnmaildir
>   folders, only 2982 contain a Lines: header.)
>
> - [unrelated] Above the quoted code section, the function checks if the
>   NOV data have to be (re)created by parsing the message; if not, it
>   raises an exception to return early.  This construct should be
>   replaced by a conditional, perhaps splitting out the second half into
>   its own function for readability.

Both things seem reasonable, so if somebody wants to do that (or rewrite
that function to be less confusing in general), I'm all for it.  But as
your change fixes this bug, I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.