2008-08-30 Eli Zaretskii <eliz@gnu.org>
+ * w16select.c (Fw16_set_clipboard_data): Don't encode text if
+ clipboard is unavailable. Set dst to NULL if it doesn't point to
+ malloc'ed data.
+ (Fw16_get_clipboard_data): Initialize htext to NULL, to avoid
+ passing random values to xfree.
+
* dispnew.c (init_display): Set `tty's association in frame's
parameters alist to the name of the terminal device, if that is
known.
BLOCK_INPUT;
+ if (!open_clipboard ())
+ goto error;
+
nbytes = SBYTES (string);
src = SDATA (string);
will have to convert it to DOS CR-LF style. */
no_crlf_conversion = 0;
Vlast_coding_system_used = Qraw_text;
+ dst = NULL; /* so we don't try to free a random pointer */
}
else
{
src = dst;
}
- if (!open_clipboard ())
- goto error;
-
ok = empty_clipboard ()
&& ((put_status
= set_clipboard_data (CF_OEMTEXT, src, nbytes, no_crlf_conversion))
Lisp_Object frame;
{
unsigned data_size, truelen;
- unsigned char *htext;
+ unsigned char *htext = NULL;
Lisp_Object ret = Qnil;
int no_crlf_conversion, require_decoding = 0;