Mercurial > emacs
changeset 88509:0ac97e7062f5
(x_encode_text): Allocate coding.destination here, and
call encode_coding_object with dst_object Qnil.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 14 May 2002 13:02:54 +0000 |
parents | 2099aaefdcbb |
children | d266b8fb8761 |
files | src/xfns.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xfns.c Tue May 14 11:51:08 2002 +0000 +++ b/src/xfns.c Tue May 14 13:02:54 2002 +0000 @@ -2378,12 +2378,14 @@ 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; }