changeset 24257:7507c0552393

(Fw16_set_clipboard_data): When the text needs to be encoded, set its pointer and size as returned by encode_coding.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 03 Feb 1999 14:53:47 +0000
parents 47e6aa168a66
children 63101e55ebea
files src/w16select.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/w16select.c	Wed Feb 03 06:26:56 1999 +0000
+++ b/src/w16select.c	Wed Feb 03 14:53:47 1999 +0000
@@ -475,6 +475,7 @@
       /* 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 @@
       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 @@
   
   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)