From: Kenichi Handa Date: Tue, 14 May 2002 13:02:54 +0000 (+0000) Subject: (x_encode_text): Allocate coding.destination here, and X-Git-Tag: emacs-pretest-23.0.90~8295^2~1864^2~881 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b954d58692f82f5e41bb3ec3d692c3a1e36e6c89;p=emacs.git (x_encode_text): Allocate coding.destination here, and call encode_coding_object with dst_object Qnil. --- diff --git a/src/xfns.c b/src/xfns.c index b393578d52c..7f75550c184 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2378,12 +2378,14 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp) coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK); /* We suppress producing escape sequences for composition. */ coding.common_flags &= ~CODING_ANNOTATION_MASK; + coding.dst_bytes = XSTRING (string)->size * 2; + coding.destination = (unsigned char *) xmalloc (coding.dst_bytes); encode_coding_object (&coding, string, 0, 0, XSTRING (string)->size, - STRING_BYTES (XSTRING (string)), Qt); + STRING_BYTES (XSTRING (string)), Qnil); *text_bytes = coding.produced; *stringp = (result == 1 || !EQ (coding_system, Qcompound_text)); - return XSTRING (coding.dst_object)->data; + return coding.destination; }