diff options
| author | Chong Yidong | 2010-11-27 15:04:57 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-11-27 15:04:57 -0500 |
| commit | 07976ae3b816dea4fd541bbba862603d3132eb2c (patch) | |
| tree | 4a437b7cb3abb01fb144530a130c991882a1b7f2 /src/coding.c | |
| parent | 9610796712a3bc43730c99005906571a2c0bccbd (diff) | |
| parent | 402c8a49571227f8a4e678d4a6cdd6ba7841aef9 (diff) | |
| download | emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.tar.gz emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.zip | |
Merge changes from emacs-23 branch
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/coding.c b/src/coding.c index c834f76a65e..a7b7c7d6b23 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -2053,7 +2053,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2053 | const unsigned char *src_end = coding->source + coding->src_bytes; | 2053 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 2054 | const unsigned char *src_base = src; | 2054 | const unsigned char *src_base = src; |
| 2055 | int multibytep = coding->src_multibyte; | 2055 | int multibytep = coding->src_multibyte; |
| 2056 | struct charset *charset; | 2056 | int charset_id; |
| 2057 | unsigned code; | 2057 | unsigned code; |
| 2058 | int c; | 2058 | int c; |
| 2059 | int consumed_chars = 0; | 2059 | int consumed_chars = 0; |
| @@ -2063,7 +2063,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2063 | if (c < 0) | 2063 | if (c < 0) |
| 2064 | { | 2064 | { |
| 2065 | c = -c; | 2065 | c = -c; |
| 2066 | charset = emacs_mule_charset[0]; | 2066 | charset_id = emacs_mule_charset[0]; |
| 2067 | } | 2067 | } |
| 2068 | else | 2068 | else |
| 2069 | { | 2069 | { |
| @@ -2099,7 +2099,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2099 | switch (emacs_mule_bytes[c]) | 2099 | switch (emacs_mule_bytes[c]) |
| 2100 | { | 2100 | { |
| 2101 | case 2: | 2101 | case 2: |
| 2102 | if (! (charset = emacs_mule_charset[c])) | 2102 | if ((charset_id = emacs_mule_charset[c]) < 0) |
| 2103 | goto invalid_code; | 2103 | goto invalid_code; |
| 2104 | ONE_MORE_BYTE (c); | 2104 | ONE_MORE_BYTE (c); |
| 2105 | if (c < 0xA0) | 2105 | if (c < 0xA0) |
| @@ -2112,7 +2112,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2112 | || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) | 2112 | || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) |
| 2113 | { | 2113 | { |
| 2114 | ONE_MORE_BYTE (c); | 2114 | ONE_MORE_BYTE (c); |
| 2115 | if (c < 0xA0 || ! (charset = emacs_mule_charset[c])) | 2115 | if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0) |
| 2116 | goto invalid_code; | 2116 | goto invalid_code; |
| 2117 | ONE_MORE_BYTE (c); | 2117 | ONE_MORE_BYTE (c); |
| 2118 | if (c < 0xA0) | 2118 | if (c < 0xA0) |
| @@ -2121,7 +2121,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2121 | } | 2121 | } |
| 2122 | else | 2122 | else |
| 2123 | { | 2123 | { |
| 2124 | if (! (charset = emacs_mule_charset[c])) | 2124 | if ((charset_id = emacs_mule_charset[c]) < 0) |
| 2125 | goto invalid_code; | 2125 | goto invalid_code; |
| 2126 | ONE_MORE_BYTE (c); | 2126 | ONE_MORE_BYTE (c); |
| 2127 | if (c < 0xA0) | 2127 | if (c < 0xA0) |
| @@ -2136,7 +2136,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2136 | 2136 | ||
| 2137 | case 4: | 2137 | case 4: |
| 2138 | ONE_MORE_BYTE (c); | 2138 | ONE_MORE_BYTE (c); |
| 2139 | if (c < 0 || ! (charset = emacs_mule_charset[c])) | 2139 | if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0) |
| 2140 | goto invalid_code; | 2140 | goto invalid_code; |
| 2141 | ONE_MORE_BYTE (c); | 2141 | ONE_MORE_BYTE (c); |
| 2142 | if (c < 0xA0) | 2142 | if (c < 0xA0) |
| @@ -2150,21 +2150,21 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2150 | 2150 | ||
| 2151 | case 1: | 2151 | case 1: |
| 2152 | code = c; | 2152 | code = c; |
| 2153 | charset = CHARSET_FROM_ID (ASCII_BYTE_P (code) | 2153 | charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit; |
| 2154 | ? charset_ascii : charset_eight_bit); | ||
| 2155 | break; | 2154 | break; |
| 2156 | 2155 | ||
| 2157 | default: | 2156 | default: |
| 2158 | abort (); | 2157 | abort (); |
| 2159 | } | 2158 | } |
| 2160 | CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c); | 2159 | CODING_DECODE_CHAR (coding, src, src_base, src_end, |
| 2160 | CHARSET_FROM_ID (charset_id), code, c); | ||
| 2161 | if (c < 0) | 2161 | if (c < 0) |
| 2162 | goto invalid_code; | 2162 | goto invalid_code; |
| 2163 | } | 2163 | } |
| 2164 | *nbytes = src - src_base; | 2164 | *nbytes = src - src_base; |
| 2165 | *nchars = consumed_chars; | 2165 | *nchars = consumed_chars; |
| 2166 | if (id) | 2166 | if (id) |
| 2167 | *id = charset->id; | 2167 | *id = charset_id; |
| 2168 | return (mseq_found ? -c : c); | 2168 | return (mseq_found ? -c : c); |
| 2169 | 2169 | ||
| 2170 | no_more_source: | 2170 | no_more_source: |