Re: mutt/1680: Mutt breaks threads if duplicate Message-IDs in References
The following reply was made to PR mutt/1680; it has been noted by GNATS.
From: Vincent Lefevre <vincent@xxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc:
Subject: Re: mutt/1680: Mutt breaks threads if duplicate Message-IDs in
References
Date: Sat, 10 Sep 2005 02:37:40 +0200
--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
On 2005-09-06 08:01:31 +0200, Brendan Cully wrote:
> Was this fixed recently? It sounds very familiar...
This is fixed by patch-1.5.8.tamo.rm_dupref.1 (attached), but this
patch hasn't been committed to the CVS yet.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-1.5.8.tamo.rm_dupref.1"
--- parse.c.BAK 2005-03-20 15:00:24.000000000 +0900
+++ parse.c 2005-03-20 16:07:40.000000000 +0900
@@ -141,6 +141,30 @@
FREE (&new);
else
{
+ /* If NEW is already in LST, remove the old one.
+ * Because we need only the most recent message-id
+ * for making thread trees. Two identical message-id's
+ * in an env->references could break threads.
+ * - Reported by Vincent, 2005.
+ */
+ LIST *l = lst, *prev = NULL;
+ while (l)
+ {
+ if (!strcmp (l->data, new))
+ {
+ LIST *tmp = l;
+ if (prev)
+ l = prev->next = l->next;
+ else
+ l = lst = lst->next;
+ FREE (&tmp->data);
+ FREE (&tmp);
+ }
+ else
+ prev = l, l = l->next;
+ }
+
+ /* Now LST is ready for merging */
t = (LIST *) safe_malloc (sizeof (LIST));
t->data = new;
t->next = lst;
--dDRMvlgZJXvWKvBx--