]> git.eshelyaron.com Git - emacs.git/commitdiff
(casify_object): Fix for the case that case
authorKenichi Handa <handa@m17n.org>
Fri, 14 Oct 2005 07:51:51 +0000 (07:51 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 14 Oct 2005 07:51:51 +0000 (07:51 +0000)
conversion change the byte length.

src/casefiddle.c

index 454d184b99b19e69d82089b12dd5d0ce2239166e..dee68fcf8c0a9346e63f414230d8345bd6da5934 100644 (file)
@@ -92,7 +92,8 @@ casify_object (flag, obj)
              else if (!UPPERCASEP (c)
                       && (!inword || flag != CASE_CAPITALIZE_UP))
                c = UPCASE1 (c);
-             if (ASCII_BYTE_P (c) || (! multibyte && SINGLE_BYTE_CHAR_P (c)))
+             if ((ASCII_BYTE_P (c) && from_len == 1)
+                 || (! multibyte && SINGLE_BYTE_CHAR_P (c)))
                SSET (obj, i, c);
              else
                {
@@ -100,7 +101,10 @@ casify_object (flag, obj)
                  if (from_len == to_len)
                    CHAR_STRING (c, SDATA (obj) + i);
                  else
-                   Faset (obj, make_number (n), make_number (c));
+                   {
+                     Faset (obj, make_number (n), make_number (c));
+                     len += to_len - from_len;
+                   }
                }
              if ((int) flag >= (int) CASE_CAPITALIZE)
                inword = SYNTAX (c) == Sword;