Hi, * David Champion [06-04-28 10:55:50 -0500] wrote:
Here's the patched code in hdrline.c:
- if (hdr->content->parts) - count = mutt_count_body_parts(hdr, 0); - else - { - mutt_parse_mime_message(ctx, hdr); - count = mutt_count_body_parts(hdr, 0); - mutt_free_body(&hdr->content->parts); - } - + if (!hdr->content->parts) + mutt_parse_mime_message (ctx, hdr); + count = mutt_count_body_parts (hdr, 0);+
[ sorry for snipping ]
Rocco: are you certain that this is a problem in current cvs?
Yes. I see it with maildir. Just open a folder when %X is in $index_format and then go from top to bottom with PageUp and PageDown all the time. Messages get re-parsed all the time.
IMHO the problem is that mutt_free_body() will clear out hdr->content->parts so that next time the mutt_count_body_parts() function in the if-part isn't called because hdr->content->parts was cleared and thus caching doesn't have any affect.
Otherwise, we should figure out why mutt_count_body_parts() is falling through the cache check and fix that instead.
As said, I believe that hdr->content->parts is 0 the first time. Afterwards the else-part is called which does:
mutt_parse_mime_message() count = ... mutt_free_body()whereby the last call removes hdr->content->parts so that next time it's 0 again and the 3 functions are called again.
bye, Rocco -- :wq!