diff options
author | Kenichi Handa <handa@gnu.org> | 2013-07-20 20:51:53 +0900 |
---|---|---|
committer | Kenichi Handa <handa@gnu.org> | 2013-07-20 20:51:53 +0900 |
commit | 7e67809332c7ac0c798eb13d5573a5804db8134e (patch) | |
tree | ee8d4702ed94e7179ae30740f6575ca698539d30 /src/coding.c | |
parent | 0efe47a860bba25617132f02e2220056bfa098b0 (diff) | |
parent | 6b1b199dc0e3e7f8028fabe87fac446f5a845479 (diff) | |
download | emacs-7e67809332c7ac0c798eb13d5573a5804db8134e.tar.gz |
merge trunk
Diffstat (limited to 'src/coding.c')
-rw-r--r-- | src/coding.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c index 3acbd090e13..0cdd8f9cd9e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1365,6 +1365,45 @@ decode_coding_utf_8 (struct coding_system *coding) break; } + /* In the simple case, rapidly handle ordinary characters */ + if (multibytep && ! eol_dos + && charbuf < charbuf_end - 6 && src < src_end - 6) + { + while (charbuf < charbuf_end - 6 && src < src_end - 6) + { + c1 = *src; + if (c1 & 0x80) + break; + src++; + consumed_chars++; + *charbuf++ = c1; + + c1 = *src; + if (c1 & 0x80) + break; + src++; + consumed_chars++; + *charbuf++ = c1; + + c1 = *src; + if (c1 & 0x80) + break; + src++; + consumed_chars++; + *charbuf++ = c1; + + c1 = *src; + if (c1 & 0x80) + break; + src++; + consumed_chars++; + *charbuf++ = c1; + } + /* If we handled at least one character, restart the main loop. */ + if (src != src_base) + continue; + } + if (byte_after_cr >= 0) c1 = byte_after_cr, byte_after_cr = -1; else |