summaryrefslogtreecommitdiff
path: root/src/xselect.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1998-04-02 00:25:47 +0000
committerKenichi Handa <handa@m17n.org>1998-04-02 00:25:47 +0000
commit736724c00cc679d6ae07e3d98b0e1695595f089d (patch)
tree0f960fe7735462d3fd037cef54d6cac37a74fb5c /src/xselect.c
parent7e3aefc85c6b9606934fea092f75c107b16cb248 (diff)
downloademacs-736724c00cc679d6ae07e3d98b0e1695595f089d.tar.gz
(selection_data_to_lisp_data): Give
make_string_from_bytes a correct char size.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 5eb7d432158..0a6978ec5c2 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -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;