]> granicus.if.org Git - neomutt/commitdiff
Improved limit-to-all detection by skipping leading spaces of the pattern
authorVincent Lefevre <vincent@vinc17.net>
Sun, 22 Jul 2018 00:57:32 +0000 (02:57 +0200)
committerRichard Russon <rich@flatcap.org>
Sat, 1 Sep 2018 17:06:08 +0000 (18:06 +0100)
There are many equivalent limit-to-all patterns, but in practice, one
may want to limit to " ~A" in order to prevent the pattern from being
recorded in the history. Thus it is important to detect at least this
pattern and similar ones.

pattern.c

index ba6e63503230293eb0db8aee290e83cb17a2ab6c..7d3860c0d1951b76aa6d69201a8860c9496e7752 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -2314,7 +2314,10 @@ int mutt_pattern_func(int op, char *prompt)
       mutt_error(_("No messages matched criteria"));
 
     /* record new limit pattern, unless match all */
-    if (mutt_str_strcmp(buf, "~A") != 0)
+    char *pbuf = buf;
+    while (*pbuf == ' ')
+      pbuf++;
+    if (mutt_str_strcmp(pbuf, "~A") != 0)
     {
       Context->pattern = simple;
       simple = NULL; /* don't clobber it */