]> granicus.if.org Git - neomutt/commitdiff
Fix mailbox search to not recompile for a repeated search
authorKevin McCarthy <kevin@8t8.us>
Sun, 28 Apr 2019 22:48:33 +0000 (15:48 -0700)
committerRichard Russon <rich@flatcap.org>
Sun, 5 May 2019 00:00:38 +0000 (01:00 +0100)
The LastSearchExpn was being compared, but was never set to the
expanded search value.  This was causing the search to be recompiled
even if it were for the same previous expanded search string.

Co-authored-by: Richard Russon <rich@flatcap.org>
pattern.c

index db05bd86826144789701b8b965ac572484c6e48b..76df32a682569d4e25ca75fc2c3a0d5780da4ca6 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -2556,6 +2556,7 @@ int mutt_search_command(int cur, int op)
       mutt_buffer_init(&err);
       OptSearchInvalid = true;
       mutt_str_strfcpy(LastSearch, buf, sizeof(LastSearch));
+      mutt_str_strfcpy(LastSearchExpn, mutt_b2s(tmp), sizeof(LastSearchExpn));
       mutt_message(_("Compiling search pattern..."));
       mutt_pattern_free(&SearchPattern);
       err.dsize = 256;
@@ -2567,6 +2568,7 @@ int mutt_search_command(int cur, int op)
         mutt_error("%s", err.data);
         FREE(&err.data);
         LastSearch[0] = '\0';
+        LastSearchExpn[0] = '\0';
         return -1;
       }
       FREE(&err.data);