comparison 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
comparison
equal deleted inserted replaced
20934:eebcbb4b56bd 20935:2fc5eb0799fe
1677 1677
1678 static int 1678 static int
1679 advance_to_char_boundary (byte_pos) 1679 advance_to_char_boundary (byte_pos)
1680 int byte_pos; 1680 int byte_pos;
1681 { 1681 {
1682 int pos = byte_pos; 1682 int c = FETCH_BYTE (byte_pos);
1683 1683
1684 while (1) 1684 while (! CHAR_HEAD_P (c))
1685 { 1685 {
1686 int c = FETCH_BYTE (pos); 1686 byte_pos++;
1687 if (SINGLE_BYTE_CHAR_P (c)) 1687 c = FETCH_BYTE (byte_pos);
1688 break; 1688 }
1689 if (c == LEADING_CODE_COMPOSITION) 1689
1690 break; 1690 return byte_pos;
1691 if (BYTES_BY_CHAR_HEAD (c) > 1)
1692 break;
1693 pos++;
1694 }
1695
1696 return pos;
1697 } 1691 }
1698 1692
1699 DEFUN ("set-buffer-multibyte", Fset_buffer_multibyte, Sset_buffer_multibyte, 1693 DEFUN ("set-buffer-multibyte", Fset_buffer_multibyte, Sset_buffer_multibyte,
1700 1, 1, 0, 1694 1, 1, 0,
1701 "Set the multibyte flag of the current buffer to FLAG.\n\ 1695 "Set the multibyte flag of the current buffer to FLAG.\n\