Rocco Rutte:
[apps/madmutt.git] / pattern.c
index 81bebdd..7813d55 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -218,7 +218,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
       if (pat->op == M_HEADER) {
         if (*(buf = mutt_read_rfc822_line (fp, buf, &blen)) == '\0')
           break;
-      } if (fgets (buf, blen - 1, fp) == NULL)
+      } else if (fgets (buf, blen - 1, fp) == NULL)
         break;                  /* don't loop forever */
       if (patmatch (pat, buf) == 0) {
         match = 1;
@@ -684,7 +684,7 @@ void mutt_pattern_free (pattern_t ** pat)
       regfree (tmp->rx);
       mem_free (&tmp->rx);
     }
-    mem_free (tmp->str);
+    mem_free (&tmp->str);
     if (tmp->child)
       mutt_pattern_free (&tmp->child);
     mem_free (&tmp);
@@ -698,7 +698,6 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err)
   pattern_t *last = NULL;
   int not = 0;
   int alladdr = 0;
-  int stringmatch = 0;
   int or = 0;
   int implicit = 1;             /* used to detect logical AND operator */
   struct pattern_flags *entry;
@@ -744,10 +743,8 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err)
       implicit = 0;
       not = 0;
       alladdr = 0;
-      stringmatch = 0;
       break;
     case '=':
-      stringmatch = 1;
       /* fallthrough */
     case '~':
       if (implicit && or) {
@@ -763,10 +760,9 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err)
       tmp = new_pattern ();
       tmp->not = not;
       tmp->alladdr = alladdr;
-      tmp->stringmatch = stringmatch;
+      tmp->stringmatch = (*ps.dptr == '=') ? 1 : 0;
       not = 0;
       alladdr = 0;
-      stringmatch = 0;
 
       if (last)
         last->next = tmp;