From: Richard M. Stallman Date: Fri, 17 Apr 1998 23:35:14 +0000 (+0000) Subject: (readchar): Find the previous byte's address properly X-Git-Tag: emacs-20.3~1440 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ae07613263106995d4ec33b59901a2007c23f0f;p=emacs.git (readchar): Find the previous byte's address properly for the buffer case, as for the marker case. --- 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)) {