summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-04-17 23:35:14 +0000
committerRichard M. Stallman <rms@gnu.org>1998-04-17 23:35:14 +0000
commit5ae07613263106995d4ec33b59901a2007c23f0f (patch)
treeb134b8b5d7dca132fd8d5bc9228c31dbe73ccecc
parent4e6724a8e7d64a08d2b16f21603da11e2ed66ed5 (diff)
downloademacs-5ae07613263106995d4ec33b59901a2007c23f0f.tar.gz
emacs-5ae07613263106995d4ec33b59901a2007c23f0f.tar.bz2
emacs-5ae07613263106995d4ec33b59901a2007c23f0f.zip
(readchar): Find the previous byte's address properly
for the buffer case, as for the marker case.
-rw-r--r--src/lread.c8
1 files 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))
{