]> granicus.if.org Git - mutt/commitdiff
patch-1.3.23.2-de-new_threads.2
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 12 Nov 2001 09:53:54 +0000 (09:53 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 12 Nov 2001 09:53:54 +0000 (09:53 +0000)
sort.c
thread.c

diff --git a/sort.c b/sort.c
index 2792da2b722afaadda4abd5ab00753511d92e222..4043b0b789432e8e7002e5f86e37210ae84eb3c1 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -207,6 +207,14 @@ void mutt_sort_headers (CONTEXT *ctx, int init)
   }
   unset_option (OPTNEEDRESCORE);
 
+  if (option (OPTRESORTINIT))
+  {
+    unset_option (OPTRESORTINIT);
+    init = 1;
+  }
+
+  if (init && ctx->tree)
+    mutt_clear_threads (ctx);
 
   if ((Sort & SORT_MASK) == SORT_THREADS)
   {
@@ -222,11 +230,6 @@ void mutt_sort_headers (CONTEXT *ctx, int init)
       Sort = i;
       unset_option (OPTSORTSUBTHREADS);
     }
-    if (option (OPTRESORTINIT))
-    {
-      unset_option (OPTRESORTINIT);
-      init = 1;
-    }
     mutt_sort_threads (ctx, init);
   }
   else if ((sortfunc = mutt_get_sort_func (Sort)) == NULL ||
index e6df19ad7a3e51f3e89511a39defcef38b0dfd64..f0392853d72cc9a5101a1e9a62d5d2227af490bc 100644 (file)
--- a/thread.c
+++ b/thread.c
@@ -655,10 +655,7 @@ void mutt_sort_threads (CONTEXT *ctx, int init)
     init = 1;
 
   if (init)
-  {
-    mutt_clear_threads (ctx);
     ctx->thread_hash = hash_create (ctx->msgcount * 2);
-  }
 
   /* we want a quick way to see if things are actually attached to the top of the
    * thread tree or if they're just dangling, so we attach everything to a top