diff options
| author | Kenichi Handa | 1998-09-07 13:39:15 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-09-07 13:39:15 +0000 |
| commit | b57a7b0bf4da9bd1e48939778e597b772803b5a1 (patch) | |
| tree | c81a755cf465d29eebd1d7edc949aa27502eb336 /src | |
| parent | 8783b77f5b102e14378a759d556cae4cdf3efc2b (diff) | |
| download | emacs-b57a7b0bf4da9bd1e48939778e597b772803b5a1.tar.gz emacs-b57a7b0bf4da9bd1e48939778e597b772803b5a1.zip | |
(count_combining_after): Check also preceding bytes at
POS if all characters in STRING are not character head.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/insdel.c b/src/insdel.c index fb29518fe89..9a3aebfbc0a 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -950,11 +950,23 @@ count_combining_after (string, length, pos, pos_byte) | |||
| 950 | if (length == 0 || ASCII_BYTE_P (string[length - 1])) | 950 | if (length == 0 || ASCII_BYTE_P (string[length - 1])) |
| 951 | return 0; | 951 | return 0; |
| 952 | i = length - 1; | 952 | i = length - 1; |
| 953 | while (i > 0 && ! CHAR_HEAD_P (string[i])) | 953 | while (i >= 0 && ! CHAR_HEAD_P (string[i])) |
| 954 | { | 954 | { |
| 955 | i--; | 955 | i--; |
| 956 | } | 956 | } |
| 957 | if (! BASE_LEADING_CODE_P (string[i])) | 957 | if (i < 0) |
| 958 | { | ||
| 959 | /* All characters in `string' are not character head. | ||
| 960 | We must check also preceding bytes at POS. | ||
| 961 | We are sure that the gap is at POS. */ | ||
| 962 | string = BEG_ADDR; | ||
| 963 | i = pos_byte - 2; | ||
| 964 | while (i >= 0 && ! CHAR_HEAD_P (string[i])) | ||
| 965 | i--; | ||
| 966 | if (i < 0 || !BASE_LEADING_CODE_P (string[i])) | ||
| 967 | return 0; | ||
| 968 | } | ||
| 969 | else if (!BASE_LEADING_CODE_P (string[i])) | ||
| 958 | return 0; | 970 | return 0; |
| 959 | 971 | ||
| 960 | if (pos == ZV) | 972 | if (pos == ZV) |