From 5ae07613263106995d4ec33b59901a2007c23f0f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 17 Apr 1998 23:35:14 +0000 Subject: [PATCH] (readchar): Find the previous byte's address properly for the buffer case, as for the marker case. --- src/lread.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lread.c b/src/lread.c index f07ec2dc780..0d7238ddf35 100644 --- a/src/lread.c +++ b/src/lread.c @@ -218,8 +218,12 @@ readchar (readcharfun) readchar_backlog = bytepos - orig_bytepos; } - return *(BUF_BEG_ADDR (inbuffer) + XMARKER (readcharfun)->bytepos - - readchar_backlog--); + /* We get the address of the byte just passed, + which is the last byte of the character. + The other bytes in this character are consecutive with it, + because the gap can't be in the middle of a character. */ + return *(BUF_BYTE_ADDRESS (inbuffer, XMARKER (readcharfun)->bytepos - 1) + - --readchar_backlog); } if (EQ (readcharfun, Qget_file_char)) { -- 2.39.2