changeset 21330:146e9f0c310b

(selection_data_to_lisp_data): Give make_string_from_bytes a correct char size.
author Kenichi Handa <handa@m17n.org>
date Thu, 02 Apr 1998 00:25:47 +0000
parents 58dc75416c30
children 4c89837392b3
files src/xselect.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xselect.c	Wed Apr 01 12:26:43 1998 +0000
+++ b/src/xselect.c	Thu Apr 02 00:25:47 1998 +0000
@@ -1506,8 +1506,10 @@
 	  bufsize = decoding_buffer_size (&coding, size);
 	  buf = (unsigned char *) xmalloc (bufsize);
 	  decode_coding (&coding, data, buf, size, bufsize);
-	  str = make_string_from_bytes ((char *) buf,
-					coding.produced_char, coding.produced);
+	  size = (coding.fake_multibyte
+		  ? multibyte_chars_in_text (buf, coding.produced)
+		  : coding.produced_char);
+	  str = make_string_from_bytes ((char *) buf, size, coding.produced);
 	  xfree (buf);
 	}
       return str;