Mercurial > emacs
diff src/buffer.c @ 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 | 83f23c9f7c4d |
| children | abc60038dd2b |
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,
