]> git.eshelyaron.com Git - emacs.git/commitdiff
(advance_to_char_boundary): Make the behaviour
authorKenichi Handa <handa@m17n.org>
Fri, 20 Feb 1998 01:40:47 +0000 (01:40 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 20 Feb 1998 01:40:47 +0000 (01:40 +0000)
consistent with INC_POS.

src/buffer.c

index 4f0cc9a1eff0ef4f7592b87c5217c20c1a7e9d9c..323d697f06b9a2cd1176343a4993e67c24699b7d 100644 (file)
@@ -1679,21 +1679,15 @@ static int
 advance_to_char_boundary (byte_pos)
      int byte_pos;
 {
-  int pos = byte_pos;
+  int c = FETCH_BYTE (byte_pos);
 
-  while (1)
+  while (! CHAR_HEAD_P (c))
     {
-      int c = FETCH_BYTE (pos);
-      if (SINGLE_BYTE_CHAR_P (c))
-       break;
-      if (c == LEADING_CODE_COMPOSITION)
-       break;
-      if (BYTES_BY_CHAR_HEAD (c) > 1)
-       break;
-      pos++;
+      byte_pos++;
+      c = FETCH_BYTE (byte_pos);
     }
 
-  return pos;
+  return byte_pos;
 }
 
 DEFUN ("set-buffer-multibyte", Fset_buffer_multibyte, Sset_buffer_multibyte,