- int i;
-
- if (option (OPTNEEDRESCORE) && mod_score.enable) {
- if ((Sort & SORT_MASK) == SORT_SCORE ||
- (SortAux & SORT_MASK) == SORT_SCORE) {
- set_option (OPTNEEDRESORT);
- if ((Sort & SORT_MASK) == SORT_THREADS)
- set_option (OPTSORTSUBTHREADS);
- }
-
- /* must redraw the index since the user might have %N in it */
- set_option (OPTFORCEREDRAWINDEX);
- set_option (OPTFORCEREDRAWPAGER);
-
- for (i = 0; ctx && i < ctx->msgcount; i++) {
- mutt_score_message (ctx, ctx->hdrs[i], 1);
- ctx->hdrs[i]->pair = 0;
+ hdr->score = 0; /* in case of re-scoring */
+ for (score_t *tmp = Score; tmp; tmp = tmp->next) {
+ if (mutt_pattern_exec (tmp->pat, M_MATCH_FULL_ADDRESS, NULL, hdr) > 0) {
+ if (tmp->exact || tmp->val == 9999 || tmp->val == -9999) {
+ hdr->score = tmp->val;
+ break;
+ }
+ hdr->score += tmp->val;
+ }