X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=score.c;h=4bc13e62523d6173c7bae7cf24c08ca09f223732;hp=fba01f826b443edc62bcb186ee586bdfc7c73682;hb=6ae7bf50506bd40e5469719299464bdf5bc867bd;hpb=96d53ff49c308769efbf708e1e65819077cb7af6 diff --git a/score.c b/score.c index fba01f8..4bc13e6 100644 --- a/score.c +++ b/score.c @@ -13,6 +13,7 @@ #include "mutt.h" #include "sort.h" +#include "buffer.h" #include "lib/mem.h" #include "lib/intl.h" @@ -70,7 +71,7 @@ int mutt_parse_score (BUFFER * buf, BUFFER * s, unsigned long data, memset (buf, 0, sizeof (BUFFER)); mutt_extract_token (buf, s, 0); if (MoreArgs (s)) { - FREE (&pattern); + mem_free (&pattern); strfcpy (err->data, _("score: too many arguments"), err->dsize); return (-1); } @@ -78,14 +79,14 @@ int mutt_parse_score (BUFFER * buf, BUFFER * s, unsigned long data, /* look for an existing entry and update the value, else add it to the end of the list */ for (ptr = Score, last = NULL; ptr; last = ptr, ptr = ptr->next) - if (mutt_strcmp (pattern, ptr->str) == 0) + if (str_cmp (pattern, ptr->str) == 0) break; if (!ptr) { if ((pat = mutt_pattern_comp (pattern, 0, err)) == NULL) { - FREE (&pattern); + mem_free (&pattern); return (-1); } - ptr = safe_calloc (1, sizeof (SCORE)); + ptr = mem_calloc (1, sizeof (SCORE)); if (last) last->next = ptr; else @@ -135,24 +136,24 @@ int mutt_parse_unscore (BUFFER * buf, BUFFER * s, unsigned long data, while (MoreArgs (s)) { mutt_extract_token (buf, s, 0); - if (!mutt_strcmp ("*", buf->data)) { + if (!str_cmp ("*", buf->data)) { for (tmp = Score; tmp;) { last = tmp; tmp = tmp->next; mutt_pattern_free (&last->pat); - FREE (&last); + mem_free (&last); } Score = NULL; } else { for (tmp = Score; tmp; last = tmp, tmp = tmp->next) { - if (!mutt_strcmp (buf->data, tmp->str)) { + if (!str_cmp (buf->data, tmp->str)) { if (last) last->next = tmp->next; else Score = tmp->next; mutt_pattern_free (&tmp->pat); - FREE (&tmp); + mem_free (&tmp); /* there should only be one score per pattern, so we can stop here */ break; }