(Fset_buffer_multibyte): Fix 8-bit char handling.
authorKenichi Handa <handa@m17n.org>
Tue, 7 May 2002 04:49:50 +0000 (04:49 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 7 May 2002 04:49:50 +0000 (04:49 +0000)
src/buffer.c

index 87075e0..fd53972 100644 (file)
@@ -2089,7 +2089,7 @@ but the contents viewed as characters do change.  */)
            p++, pos++;
          else if (CHAR_BYTE8_HEAD_P (*p))
            {
-             c = STRING_CHAR (p, stop - pos);
+             c = STRING_CHAR_AND_LENGTH (p, stop - pos, bytes);
              /* Delete all bytes for this 8-bit character but the
                 last one, and change the last one to the charcter
                 code.  */
@@ -2176,6 +2176,7 @@ but the contents viewed as characters do change.  */)
                zv += bytes;
              if (pos <= pt)
                pt += bytes;
+             pend = Z_ADDR;
              stop = Z;
            }
        }