[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r99599: Fix handling of the multibyte
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r99599: Fix handling of the multibyte form of raw-bytes in unibyte->multibyte conversion. |
Date: |
Tue, 02 Mar 2010 13:55:33 +0900 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 99599 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: trunk
timestamp: Tue 2010-03-02 13:55:33 +0900
message:
Fix handling of the multibyte form of raw-bytes in unibyte->multibyte
conversion.
modified:
src/ChangeLog
src/character.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-03-02 01:30:52 +0000
+++ b/src/ChangeLog 2010-03-02 04:44:28 +0000
@@ -1,5 +1,9 @@
2010-03-02 Kenichi Handa <address@hidden>
+ * character.c (parse_str_as_multibyte): Fix handling of the
+ multibyte form of raw-bytes.
+ (str_as_multibyte): Likewise.
+
* buffer.c (Fset_buffer_multibyte): Fix handling of the multibyte
form of raw-bytes.
=== modified file 'src/character.c'
--- a/src/character.c 2010-01-13 08:35:10 +0000
+++ b/src/character.c 2010-03-02 04:44:28 +0000
@@ -630,7 +630,8 @@
const unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
while (str < adjusted_endp)
{
- if ((n = MULTIBYTE_LENGTH_NO_CHECK (str)) > 0)
+ if (! CHAR_BYTE8_HEAD_P (*str)
+ && (n = MULTIBYTE_LENGTH_NO_CHECK (str)) > 0)
str += n, bytes += n;
else
str++, bytes += 2;
@@ -639,7 +640,8 @@
}
while (str < endp)
{
- if ((n = MULTIBYTE_LENGTH (str, endp)) > 0)
+ if (! CHAR_BYTE8_HEAD_P (*str)
+ && (n = MULTIBYTE_LENGTH (str, endp)) > 0)
str += n, bytes += n;
else
str++, bytes += 2;
@@ -673,10 +675,13 @@
{
unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
while (p < adjusted_endp
+ && ! CHAR_BYTE8_HEAD_P (*p)
&& (n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0)
p += n, chars++;
}
- while ((n = MULTIBYTE_LENGTH (p, endp)) > 0)
+ while (p < endp
+ && ! CHAR_BYTE8_HEAD_P (*p)
+ && (n = MULTIBYTE_LENGTH (p, endp)) > 0)
p += n, chars++;
if (nchars)
*nchars = chars;
@@ -694,7 +699,8 @@
unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
while (p < adjusted_endp)
{
- if ((n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0)
+ if (! CHAR_BYTE8_HEAD_P (*p)
+ && (n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0)
{
while (n--)
*to++ = *p++;
@@ -710,7 +716,8 @@
}
while (p < endp)
{
- if ((n = MULTIBYTE_LENGTH (p, endp)) > 0)
+ if (! CHAR_BYTE8_HEAD_P (*p)
+ && (n = MULTIBYTE_LENGTH (p, endp)) > 0)
{
while (n--)
*to++ = *p++;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r99599: Fix handling of the multibyte form of raw-bytes in unibyte->multibyte conversion.,
Kenichi Handa <=