bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31837: 26.1; replace-buffer-contents doesn't work if buffer has mult


From: Philipp Stephani
Subject: bug#31837: 26.1; replace-buffer-contents doesn't work if buffer has multibyte characters
Date: Sun, 1 Jul 2018 19:32:45 +0200



Eli Zaretskii <eliz@gnu.org> schrieb am Fr., 15. Juni 2018 um 10:35 Uhr:

> I looked at the code and it looks to me like there is a very obvious bug
>  in function buffer_chars_equal in editfns.c. It calls
>  BUF_FETCH_CHAR_AS_MULTIBYTE passing *character* positions, but the
>  macro expects *byte* positions. (it would be nice if these char vs byte
>  positions could be distinguished with types, but I'm not sure it is
>  possible in C).
>
> The simple fix is to replace BUF_FETCH_CHAR_AS_MULTIBYTE with
>  STRING_CHAR (BUF_CHAR_ADDRESS (buf, pos)) and this seems to work.

Thanks, I installed a slightly different fix on the emacs-26 branch,
perhaps you could try that.

Thanks a lot for finding and fixing this (rather embarrasing) bug! 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]