Fix self-insert-command in multibyte buffers (bug#81129)

* src/cmds.c (internal_self_insert): Pass PT_BYTE to FETCH_BYTE, not
PT.
This commit is contained in:
Pip Cet 2026-05-26 14:07:11 +00:00
parent 72b50901ef
commit 25fb3f9b46

View file

@ -489,7 +489,7 @@ internal_self_insert (int c, EMACS_INT n)
SET_PT_BOTH (PT - 1, PT_BYTE - 1);
auto_fill_result = call0 (Qinternal_auto_fill);
/* Test PT < ZV in case the auto-fill-function is strange. */
if (c == '\n' && PT < ZV && FETCH_BYTE (PT) == '\n')
if (c == '\n' && PT < ZV && FETCH_BYTE (PT_BYTE) == '\n')
SET_PT_BOTH (PT + 1, PT_BYTE + 1);
if (!NILP (auto_fill_result))
hairy = 2;