<<< Date Index >>>     <<< Thread Index >>>

Fix logic error in thread.c



Hello mutt developers,

here's a tiny patch to fix a minor logic error in thread.c, and a dead
code line.

Thanks for maintaining mutt,
Ralf

diff -r 033acdc0a947 thread.c
--- a/thread.c  Mon Oct 11 07:56:47 2010 -0700
+++ b/thread.c  Mon Oct 11 18:22:31 2010 +0200
@@ -572,7 +572,7 @@
 {
   static sort_t *sort_func = NULL;
 
-  if (a || b)
+  if (a && b)
     return ((*sort_func) (&(*((THREAD **) a))->sort_key,
                          &(*((THREAD **) b))->sort_key));
   /* a hack to let us reset sort_func even though we can't
@@ -580,7 +580,6 @@
    */
   else
   {
-    sort_func = NULL;
     sort_func = mutt_get_sort_func (Sort);
     return (sort_func ? 1 : 0);
   }