comparison src/coding.c @ 21273:3d9e12cf2e63

(shrink_decoding_region): If EOL_CONVERSION is nonzero, don't skip `\r' (instead of `\n').
author Kenichi Handa <handa@m17n.org>
date Tue, 24 Mar 1998 05:41:38 +0000
parents 606fe1bb94e6
children 6d8fff47f6a0
comparison
equal deleted inserted replaced
21272:b1bc69132f55 21273:3d9e12cf2e63
3778 case coding_type_big5: 3778 case coding_type_big5:
3779 /* We can skip all ASCII characters at the head. */ 3779 /* We can skip all ASCII characters at the head. */
3780 if (coding->heading_ascii < 0) 3780 if (coding->heading_ascii < 0)
3781 { 3781 {
3782 if (eol_conversion) 3782 if (eol_conversion)
3783 while (begp < endp && *begp < 0x80 && *begp != '\n') begp++; 3783 while (begp < endp && *begp < 0x80 && *begp != '\r') begp++;
3784 else 3784 else
3785 while (begp < endp && *begp < 0x80) begp++; 3785 while (begp < endp && *begp < 0x80) begp++;
3786 } 3786 }
3787 /* We can skip all ASCII characters at the tail except for the 3787 /* We can skip all ASCII characters at the tail except for the
3788 second byte of SJIS or BIG5 code. */ 3788 second byte of SJIS or BIG5 code. */
3789 if (eol_conversion) 3789 if (eol_conversion)
3790 while (begp < endp && endp[-1] < 0x80 && endp[-1] != '\n') endp--; 3790 while (begp < endp && endp[-1] < 0x80 && endp[-1] != '\r') endp--;
3791 else 3791 else
3792 while (begp < endp && endp[-1] < 0x80) endp--; 3792 while (begp < endp && endp[-1] < 0x80) endp--;
3793 if (begp < endp && endp < endp_orig && endp[-1] >= 0x80) 3793 if (begp < endp && endp < endp_orig && endp[-1] >= 0x80)
3794 endp++; 3794 endp++;
3795 break; 3795 break;
3809 { 3809 {
3810 case CODING_CATEGORY_IDX_ISO_8_1: 3810 case CODING_CATEGORY_IDX_ISO_8_1:
3811 case CODING_CATEGORY_IDX_ISO_8_2: 3811 case CODING_CATEGORY_IDX_ISO_8_2:
3812 /* We can skip all ASCII characters at the tail. */ 3812 /* We can skip all ASCII characters at the tail. */
3813 if (eol_conversion) 3813 if (eol_conversion)
3814 while (begp < endp && (c = endp[-1]) < 0x80 && c != '\n') endp--; 3814 while (begp < endp && (c = endp[-1]) < 0x80 && c != '\r') endp--;
3815 else 3815 else
3816 while (begp < endp && endp[-1] < 0x80) endp--; 3816 while (begp < endp && endp[-1] < 0x80) endp--;
3817 break; 3817 break;
3818 3818
3819 case CODING_CATEGORY_IDX_ISO_7: 3819 case CODING_CATEGORY_IDX_ISO_7:
3820 case CODING_CATEGORY_IDX_ISO_7_TIGHT: 3820 case CODING_CATEGORY_IDX_ISO_7_TIGHT:
3821 /* We can skip all charactes at the tail except for ESC and 3821 /* We can skip all charactes at the tail except for ESC and
3822 the following 2-byte at the tail. */ 3822 the following 2-byte at the tail. */
3823 if (eol_conversion) 3823 if (eol_conversion)
3824 while (begp < endp 3824 while (begp < endp
3825 && (c = endp[-1]) < 0x80 && c != ISO_CODE_ESC && c != '\n') 3825 && (c = endp[-1]) < 0x80 && c != ISO_CODE_ESC && c != '\r')
3826 endp--; 3826 endp--;
3827 else 3827 else
3828 while (begp < endp 3828 while (begp < endp
3829 && (c = endp[-1]) < 0x80 && c != ISO_CODE_ESC) 3829 && (c = endp[-1]) < 0x80 && c != ISO_CODE_ESC)
3830 endp--; 3830 endp--;