diff options
| author | Kenichi Handa | 2002-05-14 13:02:54 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-05-14 13:02:54 +0000 |
| commit | b954d58692f82f5e41bb3ec3d692c3a1e36e6c89 (patch) | |
| tree | cdff43c955aba77f82f1c1b6182019258dbf595b /src | |
| parent | 8c2fc3113421adfb4db33064fc54569ffedfa6b5 (diff) | |
| download | emacs-b954d58692f82f5e41bb3ec3d692c3a1e36e6c89.tar.gz emacs-b954d58692f82f5e41bb3ec3d692c3a1e36e6c89.zip | |
(x_encode_text): Allocate coding.destination here, and
call encode_coding_object with dst_object Qnil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) | |||
| 2378 | coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK); | 2378 | coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK); |
| 2379 | /* We suppress producing escape sequences for composition. */ | 2379 | /* We suppress producing escape sequences for composition. */ |
| 2380 | coding.common_flags &= ~CODING_ANNOTATION_MASK; | 2380 | coding.common_flags &= ~CODING_ANNOTATION_MASK; |
| 2381 | coding.dst_bytes = XSTRING (string)->size * 2; | ||
| 2382 | coding.destination = (unsigned char *) xmalloc (coding.dst_bytes); | ||
| 2381 | encode_coding_object (&coding, string, 0, 0, | 2383 | encode_coding_object (&coding, string, 0, 0, |
| 2382 | XSTRING (string)->size, | 2384 | XSTRING (string)->size, |
| 2383 | STRING_BYTES (XSTRING (string)), Qt); | 2385 | STRING_BYTES (XSTRING (string)), Qnil); |
| 2384 | *text_bytes = coding.produced; | 2386 | *text_bytes = coding.produced; |
| 2385 | *stringp = (result == 1 || !EQ (coding_system, Qcompound_text)); | 2387 | *stringp = (result == 1 || !EQ (coding_system, Qcompound_text)); |
| 2386 | return XSTRING (coding.dst_object)->data; | 2388 | return coding.destination; |
| 2387 | } | 2389 | } |
| 2388 | 2390 | ||
| 2389 | 2391 | ||