aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2000-12-14 01:27:43 +0000
committerKenichi Handa2000-12-14 01:27:43 +0000
commit764ca8dad891809af141ca2a6d7e19a3e89955ee (patch)
tree12831146d56d7b046fd4660e80716c89d77862fc /src
parent1da1bb05a859d33100b018259458ae5436767c17 (diff)
downloademacs-764ca8dad891809af141ca2a6d7e19a3e89955ee.tar.gz
emacs-764ca8dad891809af141ca2a6d7e19a3e89955ee.zip
(decode_coding_string): Set coding->src_multibyte and
coding->dst_multibyte before calling detect_coding and detect_eol. Update them after some coding system is detected.
Diffstat (limited to 'src')
-rw-r--r--src/coding.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index 44647abaf13..6343187fb06 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5328,6 +5328,8 @@ decode_coding_string (str, coding, nocopy)
5328 to_byte = STRING_BYTES (XSTRING (str)); 5328 to_byte = STRING_BYTES (XSTRING (str));
5329 5329
5330 saved_coding_symbol = Qnil; 5330 saved_coding_symbol = Qnil;
5331 coding->src_multibyte = STRING_MULTIBYTE (str);
5332 coding->dst_multibyte = 1;
5331 if (CODING_REQUIRE_DETECTION (coding)) 5333 if (CODING_REQUIRE_DETECTION (coding))
5332 { 5334 {
5333 /* See the comments in code_convert_region. */ 5335 /* See the comments in code_convert_region. */
@@ -5350,9 +5352,10 @@ decode_coding_string (str, coding, nocopy)
5350 } 5352 }
5351 } 5353 }
5352 5354
5353 coding->src_multibyte = 0; 5355 if (coding->type == coding_type_no_conversion
5354 coding->dst_multibyte = (coding->type != coding_type_no_conversion 5356 || coding->type == coding_type_raw_text)
5355 && coding->type != coding_type_raw_text); 5357 coding->dst_multibyte = 0;
5358
5356 require_decoding = CODING_REQUIRE_DECODING (coding); 5359 require_decoding = CODING_REQUIRE_DECODING (coding);
5357 5360
5358 if (STRING_MULTIBYTE (str)) 5361 if (STRING_MULTIBYTE (str))
@@ -5361,6 +5364,7 @@ decode_coding_string (str, coding, nocopy)
5361 str = Fstring_as_unibyte (str); 5364 str = Fstring_as_unibyte (str);
5362 to_byte = STRING_BYTES (XSTRING (str)); 5365 to_byte = STRING_BYTES (XSTRING (str));
5363 nocopy = 1; 5366 nocopy = 1;
5367 coding->src_multibyte = 0;
5364 } 5368 }
5365 5369
5366 /* Try to skip the heading and tailing ASCIIs. */ 5370 /* Try to skip the heading and tailing ASCIIs. */