diff options
| author | Kenichi Handa | 1998-12-15 04:35:38 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-12-15 04:35:38 +0000 |
| commit | 67bfe42d769453352e17c53b7db2e095bf7d5523 (patch) | |
| tree | 34cefe410dea505e710caef905e0a119a4af9c5b /src | |
| parent | 040272ceb2552a84171db18185f53fccbb9fb12d (diff) | |
| download | emacs-67bfe42d769453352e17c53b7db2e095bf7d5523.tar.gz emacs-67bfe42d769453352e17c53b7db2e095bf7d5523.zip | |
(string_char_to_byte): Handle invalid multibyte sequence
correctly.
(string_byte_to_char): Likesize.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -845,7 +845,7 @@ string_char_to_byte (string, char_index) | |||
| 845 | while (best_above_byte > 0 | 845 | while (best_above_byte > 0 |
| 846 | && !CHAR_HEAD_P (XSTRING (string)->data[best_above_byte])) | 846 | && !CHAR_HEAD_P (XSTRING (string)->data[best_above_byte])) |
| 847 | best_above_byte--; | 847 | best_above_byte--; |
| 848 | if (XSTRING (string)->data[best_above_byte] < 0x80) | 848 | if (!BASE_LEADING_CODE_P (XSTRING (string)->data[best_above_byte])) |
| 849 | best_above_byte = best_above_byte_saved; | 849 | best_above_byte = best_above_byte_saved; |
| 850 | best_above--; | 850 | best_above--; |
| 851 | } | 851 | } |
| @@ -911,7 +911,7 @@ string_byte_to_char (string, byte_index) | |||
| 911 | while (best_above_byte > 0 | 911 | while (best_above_byte > 0 |
| 912 | && !CHAR_HEAD_P (XSTRING (string)->data[best_above_byte])) | 912 | && !CHAR_HEAD_P (XSTRING (string)->data[best_above_byte])) |
| 913 | best_above_byte--; | 913 | best_above_byte--; |
| 914 | if (XSTRING (string)->data[best_above_byte] < 0x80) | 914 | if (!BASE_LEADING_CODE_P (XSTRING (string)->data[best_above_byte])) |
| 915 | best_above_byte = best_above_byte_saved; | 915 | best_above_byte = best_above_byte_saved; |
| 916 | best_above--; | 916 | best_above--; |
| 917 | } | 917 | } |