diff options
| -rw-r--r-- | src/fileio.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/fileio.c b/src/fileio.c index b701d83fcd2..dbeaf64435a 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3284,7 +3284,7 @@ This does code conversion according to the value of\n\ | |||
| 3284 | But if we discover the need for conversion, we give up on this method | 3284 | But if we discover the need for conversion, we give up on this method |
| 3285 | and let the following if-statement handle the replace job. */ | 3285 | and let the following if-statement handle the replace job. */ |
| 3286 | if (!NILP (replace) | 3286 | if (!NILP (replace) |
| 3287 | && CODING_MAY_REQUIRE_NO_CONVERSION (&coding)) | 3287 | && ! CODING_REQUIRE_DECODING (&coding)) |
| 3288 | { | 3288 | { |
| 3289 | int same_at_start = BEGV; | 3289 | int same_at_start = BEGV; |
| 3290 | int same_at_end = ZV; | 3290 | int same_at_end = ZV; |
| @@ -3318,9 +3318,7 @@ This does code conversion according to the value of\n\ | |||
| 3318 | 3318 | ||
| 3319 | if (coding.type == coding_type_undecided) | 3319 | if (coding.type == coding_type_undecided) |
| 3320 | detect_coding (&coding, buffer, nread); | 3320 | detect_coding (&coding, buffer, nread); |
| 3321 | if (coding.type != coding_type_undecided | 3321 | if (CODING_REQUIRE_DECODING (&coding)) |
| 3322 | && coding.type != coding_type_no_conversion | ||
| 3323 | && coding.type != coding_type_emacs_mule) | ||
| 3324 | /* We found that the file should be decoded somehow. | 3322 | /* We found that the file should be decoded somehow. |
| 3325 | Let's give up here. */ | 3323 | Let's give up here. */ |
| 3326 | { | 3324 | { |
| @@ -3406,7 +3404,8 @@ This does code conversion according to the value of\n\ | |||
| 3406 | if (same_at_end > same_at_start | 3404 | if (same_at_end > same_at_start |
| 3407 | && FETCH_BYTE (same_at_end - 1) >= 0200 | 3405 | && FETCH_BYTE (same_at_end - 1) >= 0200 |
| 3408 | && ! NILP (current_buffer->enable_multibyte_characters) | 3406 | && ! NILP (current_buffer->enable_multibyte_characters) |
| 3409 | && ! CODING_REQUIRE_NO_CONVERSION (&coding)) | 3407 | && (CODING_REQUIRE_DECODING (&coding) |
| 3408 | || CODING_REQUIRE_DETECTION (&coding))) | ||
| 3410 | giveup_match_end = 1; | 3409 | giveup_match_end = 1; |
| 3411 | break; | 3410 | break; |
| 3412 | } | 3411 | } |
| @@ -3500,7 +3499,8 @@ This does code conversion according to the value of\n\ | |||
| 3500 | 3499 | ||
| 3501 | how_much += this; | 3500 | how_much += this; |
| 3502 | 3501 | ||
| 3503 | if (! CODING_REQUIRE_NO_CONVERSION (&coding)) | 3502 | if (CODING_REQUIRE_DECODING (&coding) |
| 3503 | || CODING_REQUIRE_DETECTION (&coding)) | ||
| 3504 | { | 3504 | { |
| 3505 | int require, produced, consumed; | 3505 | int require, produced, consumed; |
| 3506 | 3506 | ||
| @@ -3646,7 +3646,8 @@ This does code conversion according to the value of\n\ | |||
| 3646 | { | 3646 | { |
| 3647 | /* try is reserved in some compilers (Microsoft C) */ | 3647 | /* try is reserved in some compilers (Microsoft C) */ |
| 3648 | int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed); | 3648 | int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed); |
| 3649 | char *destination = (CODING_REQUIRE_NO_CONVERSION (&coding) | 3649 | char *destination = (! (CODING_REQUIRE_DECODING (&coding) |
| 3650 | || CODING_REQUIRE_DETECTION (&coding)) | ||
| 3650 | ? (char *) (POS_ADDR (PT + inserted - 1) + 1) | 3651 | ? (char *) (POS_ADDR (PT + inserted - 1) + 1) |
| 3651 | : read_buf + unprocessed); | 3652 | : read_buf + unprocessed); |
| 3652 | int this; | 3653 | int this; |
| @@ -3671,7 +3672,8 @@ This does code conversion according to the value of\n\ | |||
| 3671 | if (! not_regular) | 3672 | if (! not_regular) |
| 3672 | how_much += this; | 3673 | how_much += this; |
| 3673 | 3674 | ||
| 3674 | if (! CODING_REQUIRE_NO_CONVERSION (&coding)) | 3675 | if (CODING_REQUIRE_DECODING (&coding) |
| 3676 | || CODING_REQUIRE_DETECTION (&coding)) | ||
| 3675 | { | 3677 | { |
| 3676 | int require, produced, consumed; | 3678 | int require, produced, consumed; |
| 3677 | 3679 | ||
| @@ -4224,7 +4226,7 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 4224 | save_errno = errno; | 4226 | save_errno = errno; |
| 4225 | } | 4227 | } |
| 4226 | 4228 | ||
| 4227 | if (coding.require_flushing && !coding.last_block) | 4229 | if (CODING_REQUIRE_FLUSHING (&coding) && !coding.last_block) |
| 4228 | { | 4230 | { |
| 4229 | /* We have to flush out a data. */ | 4231 | /* We have to flush out a data. */ |
| 4230 | coding.last_block = 1; | 4232 | coding.last_block = 1; |