diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/coding.c b/src/coding.c index 01cdab52d01..91811f79bfe 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1374,7 +1374,8 @@ decode_coding_utf_8 (coding) | |||
| 1374 | int multibytep = coding->src_multibyte; | 1374 | int multibytep = coding->src_multibyte; |
| 1375 | enum utf_bom_type bom = CODING_UTF_8_BOM (coding); | 1375 | enum utf_bom_type bom = CODING_UTF_8_BOM (coding); |
| 1376 | Lisp_Object attr, charset_list; | 1376 | Lisp_Object attr, charset_list; |
| 1377 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 1377 | int eol_crlf = |
| 1378 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 1378 | int byte_after_cr = -1; | 1379 | int byte_after_cr = -1; |
| 1379 | 1380 | ||
| 1380 | CODING_GET_INFO (coding, attr, charset_list); | 1381 | CODING_GET_INFO (coding, attr, charset_list); |
| @@ -1696,7 +1697,8 @@ decode_coding_utf_16 (coding) | |||
| 1696 | enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding); | 1697 | enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding); |
| 1697 | int surrogate = CODING_UTF_16_SURROGATE (coding); | 1698 | int surrogate = CODING_UTF_16_SURROGATE (coding); |
| 1698 | Lisp_Object attr, charset_list; | 1699 | Lisp_Object attr, charset_list; |
| 1699 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 1700 | int eol_crlf = |
| 1701 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 1700 | int byte_after_cr1 = -1, byte_after_cr2 = -1; | 1702 | int byte_after_cr1 = -1, byte_after_cr2 = -1; |
| 1701 | 1703 | ||
| 1702 | CODING_GET_INFO (coding, attr, charset_list); | 1704 | CODING_GET_INFO (coding, attr, charset_list); |
| @@ -2330,7 +2332,8 @@ decode_coding_emacs_mule (coding) | |||
| 2330 | int char_offset = coding->produced_char; | 2332 | int char_offset = coding->produced_char; |
| 2331 | int last_offset = char_offset; | 2333 | int last_offset = char_offset; |
| 2332 | int last_id = charset_ascii; | 2334 | int last_id = charset_ascii; |
| 2333 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 2335 | int eol_crlf = |
| 2336 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 2334 | int byte_after_cr = -1; | 2337 | int byte_after_cr = -1; |
| 2335 | 2338 | ||
| 2336 | CODING_GET_INFO (coding, attrs, charset_list); | 2339 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -3241,7 +3244,8 @@ decode_coding_iso_2022 (coding) | |||
| 3241 | int char_offset = coding->produced_char; | 3244 | int char_offset = coding->produced_char; |
| 3242 | int last_offset = char_offset; | 3245 | int last_offset = char_offset; |
| 3243 | int last_id = charset_ascii; | 3246 | int last_id = charset_ascii; |
| 3244 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 3247 | int eol_crlf = |
| 3248 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 3245 | int byte_after_cr = -1; | 3249 | int byte_after_cr = -1; |
| 3246 | 3250 | ||
| 3247 | CODING_GET_INFO (coding, attrs, charset_list); | 3251 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -4128,7 +4132,7 @@ encode_coding_iso_2022 (coding) | |||
| 4128 | int preferred_charset_id = -1; | 4132 | int preferred_charset_id = -1; |
| 4129 | 4133 | ||
| 4130 | CODING_GET_INFO (coding, attrs, charset_list); | 4134 | CODING_GET_INFO (coding, attrs, charset_list); |
| 4131 | eol_type = CODING_ID_EOL_TYPE (coding->id); | 4135 | eol_type = inhibit_eol_conversion ? Qunix : CODING_ID_EOL_TYPE (coding->id); |
| 4132 | if (VECTORP (eol_type)) | 4136 | if (VECTORP (eol_type)) |
| 4133 | eol_type = Qunix; | 4137 | eol_type = Qunix; |
| 4134 | 4138 | ||
| @@ -4416,7 +4420,8 @@ decode_coding_sjis (coding) | |||
| 4416 | int char_offset = coding->produced_char; | 4420 | int char_offset = coding->produced_char; |
| 4417 | int last_offset = char_offset; | 4421 | int last_offset = char_offset; |
| 4418 | int last_id = charset_ascii; | 4422 | int last_id = charset_ascii; |
| 4419 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 4423 | int eol_crlf = |
| 4424 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 4420 | int byte_after_cr = -1; | 4425 | int byte_after_cr = -1; |
| 4421 | 4426 | ||
| 4422 | CODING_GET_INFO (coding, attrs, charset_list); | 4427 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -4531,7 +4536,8 @@ decode_coding_big5 (coding) | |||
| 4531 | int char_offset = coding->produced_char; | 4536 | int char_offset = coding->produced_char; |
| 4532 | int last_offset = char_offset; | 4537 | int last_offset = char_offset; |
| 4533 | int last_id = charset_ascii; | 4538 | int last_id = charset_ascii; |
| 4534 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 4539 | int eol_crlf = |
| 4540 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 4535 | int byte_after_cr = -1; | 4541 | int byte_after_cr = -1; |
| 4536 | 4542 | ||
| 4537 | CODING_GET_INFO (coding, attrs, charset_list); | 4543 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -4983,7 +4989,8 @@ static void | |||
| 4983 | decode_coding_raw_text (coding) | 4989 | decode_coding_raw_text (coding) |
| 4984 | struct coding_system *coding; | 4990 | struct coding_system *coding; |
| 4985 | { | 4991 | { |
| 4986 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 4992 | int eol_crlf = |
| 4993 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 4987 | 4994 | ||
| 4988 | coding->chars_at_source = 1; | 4995 | coding->chars_at_source = 1; |
| 4989 | coding->consumed_char = coding->src_chars; | 4996 | coding->consumed_char = coding->src_chars; |
| @@ -5202,7 +5209,8 @@ decode_coding_charset (coding) | |||
| 5202 | int char_offset = coding->produced_char; | 5209 | int char_offset = coding->produced_char; |
| 5203 | int last_offset = char_offset; | 5210 | int last_offset = char_offset; |
| 5204 | int last_id = charset_ascii; | 5211 | int last_id = charset_ascii; |
| 5205 | int eol_crlf = EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 5212 | int eol_crlf = |
| 5213 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | ||
| 5206 | int byte_after_cr = -1; | 5214 | int byte_after_cr = -1; |
| 5207 | 5215 | ||
| 5208 | CODING_GET_INFO (coding, attrs, charset_list); | 5216 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -5399,7 +5407,7 @@ setup_coding_system (coding_system, coding) | |||
| 5399 | CHECK_CODING_SYSTEM_GET_ID (coding_system, coding->id); | 5407 | CHECK_CODING_SYSTEM_GET_ID (coding_system, coding->id); |
| 5400 | 5408 | ||
| 5401 | attrs = CODING_ID_ATTRS (coding->id); | 5409 | attrs = CODING_ID_ATTRS (coding->id); |
| 5402 | eol_type = CODING_ID_EOL_TYPE (coding->id); | 5410 | eol_type = inhibit_eol_conversion ? Qunix : CODING_ID_EOL_TYPE (coding->id); |
| 5403 | 5411 | ||
| 5404 | coding->mode = 0; | 5412 | coding->mode = 0; |
| 5405 | coding->head_ascii = -1; | 5413 | coding->head_ascii = -1; |
| @@ -6144,7 +6152,7 @@ decode_eol (coding) | |||
| 6144 | unsigned char *p, *pbeg, *pend; | 6152 | unsigned char *p, *pbeg, *pend; |
| 6145 | 6153 | ||
| 6146 | eol_type = CODING_ID_EOL_TYPE (coding->id); | 6154 | eol_type = CODING_ID_EOL_TYPE (coding->id); |
| 6147 | if (EQ (eol_type, Qunix)) | 6155 | if (EQ (eol_type, Qunix) || inhibit_eol_conversion) |
| 6148 | return; | 6156 | return; |
| 6149 | 6157 | ||
| 6150 | if (NILP (coding->dst_object)) | 6158 | if (NILP (coding->dst_object)) |
| @@ -6820,7 +6828,8 @@ decode_coding (coding) | |||
| 6820 | coding->consumed = coding->src_bytes; | 6828 | coding->consumed = coding->src_bytes; |
| 6821 | } | 6829 | } |
| 6822 | 6830 | ||
| 6823 | if (! EQ (CODING_ID_EOL_TYPE (coding->id), Qunix)) | 6831 | if (! EQ (CODING_ID_EOL_TYPE (coding->id), Qunix) |
| 6832 | && !inhibit_eol_conversion) | ||
| 6824 | decode_eol (coding); | 6833 | decode_eol (coding); |
| 6825 | if (BUFFERP (coding->dst_object)) | 6834 | if (BUFFERP (coding->dst_object)) |
| 6826 | { | 6835 | { |
| @@ -6971,7 +6980,7 @@ consume_chars (coding, translation_table, max_lookup) | |||
| 6971 | if (! NILP (translation_table)) | 6980 | if (! NILP (translation_table)) |
| 6972 | lookup_buf = alloca (sizeof (int) * max_lookup); | 6981 | lookup_buf = alloca (sizeof (int) * max_lookup); |
| 6973 | 6982 | ||
| 6974 | eol_type = CODING_ID_EOL_TYPE (coding->id); | 6983 | eol_type = inhibit_eol_conversion ? Qunix : CODING_ID_EOL_TYPE (coding->id); |
| 6975 | if (VECTORP (eol_type)) | 6984 | if (VECTORP (eol_type)) |
| 6976 | eol_type = Qunix; | 6985 | eol_type = Qunix; |
| 6977 | 6986 | ||