• Mattias Engdegård's avatar
    Correct regexp matching of raw bytes · a1f76adf
    Mattias Engdegård authored
    Make regexp matching of raw bytes work in all combination of unibyte
    and multibyte patterns and targets, as exact strings and in character
    alternatives (bug#3687).
    
    * src/regex-emacs.c (analyze_first):
    Include raw byte in fastmap when pattern is a multibyte exact string.
    Include leading byte in fastmap for raw bytes in character alternatives.
    (re_match_2_internal):
    Decrement the byte count by the number of bytes in the pattern character,
    not 1.
    * test/src/regex-emacs-tests.el (regexp-unibyte-unibyte)
    (regexp-multibyte-unibyte, regexp-unibyte-mutibyte)
    (regexp-multibyte-multibyte): New tests.
    a1f76adf
regex-emacs.c 148 KB