diff options
| author | Kenichi Handa | 1998-02-20 01:40:47 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-02-20 01:40:47 +0000 |
| commit | 20773569e044560bc1521507e3fdb2427a9fe535 (patch) | |
| tree | ec4c27b9455911be515a7febab1d8d7a70d95c7e /src/buffer.c | |
| parent | 39a68837f4360601f743730a58d954f12be60454 (diff) | |
| download | emacs-20773569e044560bc1521507e3fdb2427a9fe535.tar.gz emacs-20773569e044560bc1521507e3fdb2427a9fe535.zip | |
(advance_to_char_boundary): Make the behaviour
consistent with INC_POS.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/buffer.c b/src/buffer.c index 4f0cc9a1eff..323d697f06b 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1679,21 +1679,15 @@ 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; | ||
| 1689 | if (c == LEADING_CODE_COMPOSITION) | ||
| 1690 | break; | ||
| 1691 | if (BYTES_BY_CHAR_HEAD (c) > 1) | ||
| 1692 | break; | ||
| 1693 | pos++; | ||
| 1694 | } | 1688 | } |
| 1695 | 1689 | ||
| 1696 | return pos; | 1690 | return byte_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, |