Subject: Re: bug#12375: Broken matching of regexps in fancy splitting

From: jathd <[email-masked]>
Date: Mon, 12 Aug 2013 00:07:00 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> Hm.  Looking at the code, I can't see where it's re-matching against the
> original regexp.

It's around line 1470:

    (let ((value (nth 1 split)))
      (if (symbolp value)
        (setq value (cdr (assq value nnmail-split-abbrev-alist))))
      ;; Someone might want to do a \N sub on this match, so get the
      ;; correct match positions.
      (re-search-backward value start-of-value))

The `value' is the regexp I specified in `nnmail-split-fancy'. Before
that, to see whether a header matches, the function does

    (re-search-backward (cdr cached-pair) nil t)

where (cdr cached-pair) is a regexp it constructed the first time
around. Since it prepended a "\\<" to *that* regexp, the header is
correctly identified; but it didn't prepend anything to `value', so the
extraction goes wrong.

-- 
jathd