changeset 20935:2fc5eb0799fe

(advance_to_char_boundary): Make the behaviour consistent with INC_POS.
author Kenichi Handa <handa@m17n.org>
date Fri, 20 Feb 1998 01:40:47 +0000
parents eebcbb4b56bd
children 5c60cd16452b
files src/buffer.c
diffstat 1 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Fri Feb 20 01:40:47 1998 +0000
+++ b/src/buffer.c	Fri Feb 20 01:40:47 1998 +0000
@@ -1679,21 +1679,15 @@
 advance_to_char_boundary (byte_pos)
      int byte_pos;
 {
-  int pos = byte_pos;
-
-  while (1)
+  int c = FETCH_BYTE (byte_pos);
+
+  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,