diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c index e779197bbde..ad2042672b2 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -493,6 +493,8 @@ enum iso_code_class_type | |||
| 493 | 493 | ||
| 494 | #define CODING_ISO_FLAG_USE_OLDJIS 0x10000 | 494 | #define CODING_ISO_FLAG_USE_OLDJIS 0x10000 |
| 495 | 495 | ||
| 496 | #define CODING_ISO_FLAG_LEVEL_4 0x20000 | ||
| 497 | |||
| 496 | #define CODING_ISO_FLAG_FULL_SUPPORT 0x100000 | 498 | #define CODING_ISO_FLAG_FULL_SUPPORT 0x100000 |
| 497 | 499 | ||
| 498 | /* A character to be produced on output if encoding of the original | 500 | /* A character to be produced on output if encoding of the original |
| @@ -3733,7 +3735,9 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3733 | else | 3735 | else |
| 3734 | charset = CHARSET_FROM_ID (charset_id_2); | 3736 | charset = CHARSET_FROM_ID (charset_id_2); |
| 3735 | ONE_MORE_BYTE (c1); | 3737 | ONE_MORE_BYTE (c1); |
| 3736 | if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)) | 3738 | if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0) |
| 3739 | || ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LEVEL_4) | ||
| 3740 | ? c1 >= 0x80 : c1 < 0x80)) | ||
| 3737 | goto invalid_code; | 3741 | goto invalid_code; |
| 3738 | break; | 3742 | break; |
| 3739 | 3743 | ||
| @@ -3747,7 +3751,9 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3747 | else | 3751 | else |
| 3748 | charset = CHARSET_FROM_ID (charset_id_3); | 3752 | charset = CHARSET_FROM_ID (charset_id_3); |
| 3749 | ONE_MORE_BYTE (c1); | 3753 | ONE_MORE_BYTE (c1); |
| 3750 | if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)) | 3754 | if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0) |
| 3755 | || ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LEVEL_4) | ||
| 3756 | ? c1 >= 0x80 : c1 < 0x80)) | ||
| 3751 | goto invalid_code; | 3757 | goto invalid_code; |
| 3752 | break; | 3758 | break; |
| 3753 | 3759 | ||