aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2000-10-13 08:21:20 +0000
committerKenichi Handa2000-10-13 08:21:20 +0000
commite2c06b17a94a7b06cd27b643f8d5118243f06969 (patch)
tree8f6880ec4a8bb4812b4e38e5d25b864a40c77db5 /src/coding.c
parente4a3f4e178ff322ec2ece71360b7c9c0fbf06fdd (diff)
downloademacs-e2c06b17a94a7b06cd27b643f8d5118243f06969.tar.gz
emacs-e2c06b17a94a7b06cd27b643f8d5118243f06969.zip
(decode_coding_string): Set coding->src_multibyte and
coding->dst_multibyte before using CODING_REQUIRE_DECODING. (encode_coding_string): Set coding->src_multibyte and coding->dst_multibyte before using CODING_REQUIRE_ENCODING.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/coding.c b/src/coding.c
index 6d2e6d9c454..282f8e21e86 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5275,6 +5275,9 @@ decode_coding_string (str, coding, nocopy)
5275 } 5275 }
5276 } 5276 }
5277 5277
5278 coding->src_multibyte = 0;
5279 coding->dst_multibyte = (coding->type != coding_type_no_conversion
5280 && coding->type != coding_type_raw_text);
5278 require_decoding = CODING_REQUIRE_DECODING (coding); 5281 require_decoding = CODING_REQUIRE_DECODING (coding);
5279 5282
5280 if (STRING_MULTIBYTE (str)) 5283 if (STRING_MULTIBYTE (str))
@@ -5284,9 +5287,6 @@ decode_coding_string (str, coding, nocopy)
5284 to_byte = STRING_BYTES (XSTRING (str)); 5287 to_byte = STRING_BYTES (XSTRING (str));
5285 nocopy = 1; 5288 nocopy = 1;
5286 } 5289 }
5287 coding->src_multibyte = 0;
5288 coding->dst_multibyte = (coding->type != coding_type_no_conversion
5289 && coding->type != coding_type_raw_text);
5290 5290
5291 /* Try to skip the heading and tailing ASCIIs. */ 5291 /* Try to skip the heading and tailing ASCIIs. */
5292 if (require_decoding && coding->type != coding_type_ccl) 5292 if (require_decoding && coding->type != coding_type_ccl)
@@ -5420,6 +5420,11 @@ encode_coding_string (str, coding, nocopy)
5420 to_byte = STRING_BYTES (XSTRING (str)); 5420 to_byte = STRING_BYTES (XSTRING (str));
5421 5421
5422 saved_coding_symbol = Qnil; 5422 saved_coding_symbol = Qnil;
5423
5424 /* Encoding routines determine the multibyteness of the source text
5425 by coding->src_multibyte. */
5426 coding->src_multibyte = STRING_MULTIBYTE (str);
5427 coding->dst_multibyte = 0;
5423 if (! CODING_REQUIRE_ENCODING (coding)) 5428 if (! CODING_REQUIRE_ENCODING (coding))
5424 { 5429 {
5425 coding->consumed = STRING_BYTES (XSTRING (str)); 5430 coding->consumed = STRING_BYTES (XSTRING (str));
@@ -5434,11 +5439,6 @@ encode_coding_string (str, coding, nocopy)
5434 return (nocopy ? str : Fcopy_sequence (str)); 5439 return (nocopy ? str : Fcopy_sequence (str));
5435 } 5440 }
5436 5441
5437 /* Encoding routines determine the multibyteness of the source text
5438 by coding->src_multibyte. */
5439 coding->src_multibyte = STRING_MULTIBYTE (str);
5440 coding->dst_multibyte = 0;
5441
5442 if (coding->composing != COMPOSITION_DISABLED) 5442 if (coding->composing != COMPOSITION_DISABLED)
5443 coding_save_composition (coding, from, to, str); 5443 coding_save_composition (coding, from, to, str);
5444 5444