summaryrefslogtreecommitdiffstats
path: root/transcode.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-05 00:05:11 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-05 00:05:11 +0000
commit414d5071ff87e4ef65bad838f8217643e483ae78 (patch)
tree92457456e449c01a80d9dbaf543ffaef4c20803b /transcode.c
parent7d8615882a1ee4f624fe7efaf829dbb5c73a098b (diff)
downloadruby-414d5071ff87e4ef65bad838f8217643e483ae78.tar.gz
ruby-414d5071ff87e4ef65bad838f8217643e483ae78.tar.xz
ruby-414d5071ff87e4ef65bad838f8217643e483ae78.zip
Fix: DON'T move in_p because before in_p is replaced by buffered data.
* transcode.c: NOMAP is now multibyte direct map. * transcode.c: remove ASIS. * transcode_data.h: ditto. * tool/transcode-tb (ActionMap#generate_info): remove :asis. * tool/transcode-tb (ActionMap#generate_info): add :nomap0. * enc/trans/utf8_mac.trans: replace :asis by :nomap0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/transcode.c b/transcode.c
index fba247a71..36b6d777a 100644
--- a/transcode.c
+++ b/transcode.c
@@ -505,7 +505,6 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
case 30: goto resume_label30;
case 31: goto resume_label31;
case 32: goto resume_label32;
- case 33: goto resume_label33;
}
while (1) {
@@ -541,15 +540,14 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
follow_info:
switch (next_info & 0x1F) {
case NOMAP:
- SUSPEND_OBUF(3); *out_p++ = next_byte;
- continue;
- case ASIS:
{
- const unsigned char *p = inchar_start;
- while (p < in_p) {
- SUSPEND_OBUF(33); *out_p++ = (unsigned char)*p++;
+ const unsigned char *pend = in_p;
+ in_p = inchar_start;
+ while (in_p < pend) {
+ next_byte = (unsigned char)*in_p++;
+ SUSPEND_OBUF(3); *out_p++ = next_byte;
}
- }
+ }
continue;
case 0x00: case 0x04: case 0x08: case 0x0C:
case 0x10: case 0x14: case 0x18: case 0x1C: