summaryrefslogtreecommitdiff
path: root/src/w16select.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>1999-02-03 14:53:47 +0000
committerEli Zaretskii <eliz@gnu.org>1999-02-03 14:53:47 +0000
commitc7594627811730e51bc030042af9b109e2582707 (patch)
treef3937afe82c3871c5b9bde42526abb38af73739d /src/w16select.c
parent58cd41a3a054aec09eca3f1e1b675383c30efcba (diff)
downloademacs-c7594627811730e51bc030042af9b109e2582707.tar.gz
(Fw16_set_clipboard_data): When the text needs to be
encoded, set its pointer and size as returned by encode_coding.
Diffstat (limited to 'src/w16select.c')
-rw-r--r--src/w16select.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/w16select.c b/src/w16select.c
index e94a420d1a4..a5b188df19b 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -475,6 +475,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
/* No multibyte character in OBJ. We need not encode it, but we
will have to convert it to DOS CR-LF style. */
no_crlf_conversion = 0;
+ dst = src;
}
else
{
@@ -495,6 +496,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
dst = (unsigned char *) xmalloc (bufsize);
encode_coding (&coding, src, dst, nbytes, bufsize);
no_crlf_conversion = 1;
+ nbytes = coding.produced;
}
if (!open_clipboard ())
@@ -502,7 +504,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
ok = empty_clipboard ()
&& ((put_status
- = set_clipboard_data (CF_OEMTEXT, src, nbytes, no_crlf_conversion))
+ = set_clipboard_data (CF_OEMTEXT, dst, nbytes, no_crlf_conversion))
== 0);
if (!no_crlf_conversion)