]> granicus.if.org Git - neomutt/commitdiff
reuse connection in complete_all_nm_tags()
authorKarel Zak <kzak@redhat.com>
Sun, 23 Sep 2012 07:31:54 +0000 (09:31 +0200)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 15:30:06 +0000 (16:30 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
init.c

diff --git a/init.c b/init.c
index edce026705dd8c02446e682b1d7583966b492281..f2455b3cba1d0b1ac6731aee69c73a670458ddf3 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2660,9 +2660,11 @@ static int complete_all_nm_tags (const char *pt)
   memset (Matches, 0, Matches_listsize);
   memset (Completed, 0, sizeof (Completed));
 
+  nm_longrun_init(Context, FALSE);
+
   /* Work out how many tags there are. */
   if (nm_get_all_tags(Context, NULL, &tag_count_1) || tag_count_1 == 0)
-    return 0;
+    goto done;
 
   /* Free the old list, if any. */
   if (nm_tags != NULL) {
@@ -2680,6 +2682,7 @@ static int complete_all_nm_tags (const char *pt)
       tag_count_1 != tag_count_2) {
     FREE (&nm_tags);
     nm_tags = NULL;
+    nm_longrun_done(Context);
     return -1;
   }
 
@@ -2690,6 +2693,9 @@ static int complete_all_nm_tags (const char *pt)
 
   matches_ensure_morespace (Num_matched);
   Matches[Num_matched++] = User_typed;
+
+done:
+  nm_longrun_done(Context);
   return 0;
 }