From 64e0ae2a6a50facd2fe5a7758c1cbbbb306ef7c0 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 20 Feb 1998 01:40:47 +0000 Subject: [PATCH] (Finsert_file_contents): Read a file contents into the correct buffer (byte) position. Adjusted for the change of code_convert_region. --- src/fileio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 168858d9090..2a87adf6c29 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3728,7 +3728,7 @@ This does code conversion according to the value of\n\ /* Allow quitting out of the actual I/O. */ immediate_quit = 1; QUIT; - this = read (fd, BYTE_POS_ADDR (PT + inserted - 1) + 1, trytry); + this = read (fd, BYTE_POS_ADDR (PT_BYTE + inserted - 1) + 1, trytry); immediate_quit = 0; if (this <= 0) @@ -3771,7 +3771,12 @@ This does code conversion according to the value of\n\ if (inserted > 0) { if (CODING_MAY_REQUIRE_DECODING (&coding)) - inserted = code_convert_region (PT, PT + inserted, &coding, 0, 0); + { + code_convert_region (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted, + &coding, 0, 0); + inserted = (NILP (current_buffer->enable_multibyte_characters) + ? coding.produced : coding.produced_char); + } #ifdef DOS_NT /* Use the conversion type to determine buffer-file-type -- 2.39.5