GNU bug report logs - #65224
mailcap-viewer-passes-test’s caching interferes with precomputed tests

Previous Next

Package: emacs;

Reported by: Felix Dietrich <felix.dietrich <at> sperrhaken.name>

Date: Fri, 11 Aug 2023 10:50:01 UTC

Severity: normal

Tags: patch

Fixed in version 30.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #12 received at 65224-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix Dietrich <felix.dietrich <at> sperrhaken.name>
Cc: 65224-done <at> debbugs.gnu.org
Subject: Re: bug#65224: mailcap-viewer-passes-test’s caching interferes with precomputed tests
Date: Fri, 8 Sep 2023 10:20:52 -0700
Version: 30.1

Felix Dietrich <felix.dietrich <at> sperrhaken.name> writes:

> When called with a VIEWER-INFO that does not contain a test,
> ‘mailcap-viewer-passes-test’ erroneously returns nil if it had
> previously been called with a VIEWER-INFO whose test was explicitly set
> to nil.  As a consequence ‘mailcap-mime-info’ (used e.g. by
> ‘gnus-mime-view-part-externally’) may return the wrong viewer.
>
> The reason is that ‘mailcap-viewer-passes-test’ adds tests that are
> explicitly nil (i.e. (test . nil)) to the cache as (nil nil) (first the
> test, second the result) and checks for the non-existence of a test only
> after it has tried to find the test result in the cache.  The test
> variable for a VIEWER-INFO without a test is nil, and, therefore, the
> assoc lookup for nil done on the cache yields (nil nil) and, hence, nil
> (the cadr) as the test result.
>
> Moving the check for the non-existence of a test before the cache lookup
> fixes the issue; this is what the attached patch does.  In the log
> message the bug number (Bug#) needs to be filled in.

LGTM, pushed to master as commit 6d8458571f7.




This bug report was last modified 1 year and 253 days ago.

Previous Next


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