X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pattern.c;h=7813d55ad5889d9b03e6182f6fc56296e4fcbec5;hp=81bebddb6210ce49e4ecb1337178184c5905fc83;hb=6f41c52076e60ae7f2b6337b7dc9ea3fa23400e2;hpb=b85f52d2ec4d820ab5c4b577857548bec294bb27 diff --git a/pattern.c b/pattern.c index 81bebdd..7813d55 100644 --- 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;