# HG changeset patch # User Gerd Moellmann # Date 995880406 0 # Node ID 883da5f3dbacb8ffba5b56d7012f709891ef2238 # Parent 42f3fecfa483ba03ce4c94038380e6dc94fccb2f (code_convert_region): Handle the multibyte case if decoding ends with CODING_FINISH_INSUFFICIENT_SRC. diff -r 42f3fecfa483 -r 883da5f3dbac src/coding.c --- a/src/coding.c Sun Jul 22 10:53:30 2001 +0000 +++ b/src/coding.c Mon Jul 23 09:26:46 2001 +0000 @@ -1,6 +1,7 @@ /* Coding system handler (conversion, detection, and etc). Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. + Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -5615,10 +5616,26 @@ { /* The source text ends in invalid codes. Let's just make them valid buffer contents, and finish conversion. */ - inserted += len_byte; - inserted_byte += len_byte; - while (len_byte--) - *dst++ = *src++; + if (multibyte_p) + { + unsigned char *start = dst; + + inserted += len_byte; + while (len_byte--) + { + int c = *src++; + dst += CHAR_STRING (c, dst); + } + + inserted_byte += dst - start; + } + else + { + inserted += len_byte; + inserted_byte += len_byte; + while (len_byte--) + *dst++ = *src++; + } break; } if (result == CODING_FINISH_INTERRUPT)