]> code.delx.au - gnu-emacs/commitdiff
(selection_data_to_lisp_data): Give
authorKenichi Handa <handa@m17n.org>
Thu, 2 Apr 1998 00:25:47 +0000 (00:25 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 2 Apr 1998 00:25:47 +0000 (00:25 +0000)
make_string_from_bytes a correct char size.

src/xselect.c

index 5eb7d432158f0e8eb45ad6c95ca62e603ae7d16c..0a6978ec5c250633abb2940d0de79a9cbc56710f 100644 (file)
@@ -1506,8 +1506,10 @@ selection_data_to_lisp_data (display, data, size, type, format)
          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;