aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c
index 8556591e92b..b59bbce7edd 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,6 +1,7 @@
1/* Coding system handler (conversion, detection, and etc). 1/* Coding system handler (conversion, detection, and etc).
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -5615,10 +5616,26 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5615 { 5616 {
5616 /* The source text ends in invalid codes. Let's just 5617 /* The source text ends in invalid codes. Let's just
5617 make them valid buffer contents, and finish conversion. */ 5618 make them valid buffer contents, and finish conversion. */
5618 inserted += len_byte; 5619 if (multibyte_p)
5619 inserted_byte += len_byte; 5620 {
5620 while (len_byte--) 5621 unsigned char *start = dst;
5621 *dst++ = *src++; 5622
5623 inserted += len_byte;
5624 while (len_byte--)
5625 {
5626 int c = *src++;
5627 dst += CHAR_STRING (c, dst);
5628 }
5629
5630 inserted_byte += dst - start;
5631 }
5632 else
5633 {
5634 inserted += len_byte;
5635 inserted_byte += len_byte;
5636 while (len_byte--)
5637 *dst++ = *src++;
5638 }
5622 break; 5639 break;
5623 } 5640 }
5624 if (result == CODING_FINISH_INTERRUPT) 5641 if (result == CODING_FINISH_INTERRUPT)