X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=muttlib.c;h=65007ae8e9f8d0982fc43da0e4fd67d821e0091b;hp=1f6b7514bbb97f8b58a720d5315a2d498b9e5213;hb=6c292f6b369f019cc9a72a0ee65d60e172ee3370;hpb=8336b26fc23c7943bf6681ba2c290bb5cd2c54b8 diff --git a/muttlib.c b/muttlib.c index 1f6b751..65007ae 100644 --- a/muttlib.c +++ b/muttlib.c @@ -618,48 +618,6 @@ const char *mutt_make_version (int full) return vstring; } -int mutt_match_spam_list (const char *s, rx_t * l, char *text, int x) -{ - static regmatch_t *pmatch = NULL; - static int nmatch = 0; - int i, n, tlen; - char *p; - - if (!s) - return 0; - - tlen = 0; - - for (; l; l = l->next) { - /* If this pattern needs more matches, expand pmatch. */ - if (l->nmatch > nmatch) { - p_realloc(&pmatch, l->nmatch); - nmatch = l->nmatch; - } - - /* Does this pattern match? */ - if (regexec(l->rx, s, l->nmatch, (regmatch_t *)pmatch, (int) 0) == 0) { - /* Copy template into text, with substitutions. */ - for (p = l->template; *p;) { - if (*p == '%') { - n = atoi (++p); /* find pmatch index */ - while (isdigit ((unsigned char) *p)) - ++p; /* skip subst token */ - for (i = pmatch[n].rm_so; (i < pmatch[n].rm_eo) && (tlen < x); i++) - text[tlen++] = s[i]; - } - else { - text[tlen++] = *p++; - } - } - text[tlen] = '\0'; - return 1; - } - } - - return 0; -} - /* return 1 if address lists are strictly identical */ static int mutt_cmp_addr (const address_t * a, const address_t * b) {