GNU bug report logs -
#4209
23.1; Emacs 23.1 regression in re-search-forward
Previous Next
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> The preceding comment keeps me puzzled. I thought that we only ever
> matched re_patterns and buffers of the same multibyteness, i.e. if
> a unibyte regexp is matched against a multibyte buffer it should first
> be turned into a multibyte regexp and then re_compiled, so the case of:
>
> /* For the case of matching this unibyte regex
> against multibyte, we must set a leading code of
> the corresponding multibyte character. */
>
> should never happen in analyse_first. Yet, if your patch fixes the bug,
> that indicates that apparently it *does* happen.
I observe that in the original bug recipe:
(set-buffer (get-buffer-create "*Test Buffer*"))
(insert "\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A")
(goto-char (point-min))
(message "looking-at: %s" (looking-at "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A"))
(message "re-search-forward: %s"
(re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t))
If we replace
(re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t))
with
(re-search-forward (string-to-multibyte
"\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A") 100 t))
then the regexp match takes places correctly. I'm not sure why the
looking-at call works, tho.
This bug report was last modified 15 years and 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.