diff options
| author | Eli Zaretskii | 2022-04-21 23:18:42 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-04-21 23:18:42 +0300 |
| commit | 5fe7e4d1ae24047858d8633e22036d288e5f0c06 (patch) | |
| tree | 2c54a8ce95030618b068e256e0b9d8eccc46108d /src | |
| parent | e93e31c8952bf8a7acf898e4ff4d6541c897e12c (diff) | |
| download | emacs-5fe7e4d1ae24047858d8633e22036d288e5f0c06.tar.gz emacs-5fe7e4d1ae24047858d8633e22036d288e5f0c06.zip | |
Avoid a redisplay loop when 'overlay-arrow-string' is non-ASCII
* src/xdisp.c (get_overlay_arrow_glyph_row): Don't assume every
character in 'overlay-arrow-string' is one byte long. Reported by
Yuri D'Elia <wavexx@thregr.org>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 15bb5eefb56..71de3592227 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21653,7 +21653,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) | |||
| 21653 | struct buffer *buffer = XBUFFER (w->contents); | 21653 | struct buffer *buffer = XBUFFER (w->contents); |
| 21654 | struct buffer *old = current_buffer; | 21654 | struct buffer *old = current_buffer; |
| 21655 | const unsigned char *arrow_string = SDATA (overlay_arrow_string); | 21655 | const unsigned char *arrow_string = SDATA (overlay_arrow_string); |
| 21656 | ptrdiff_t arrow_len = SCHARS (overlay_arrow_string); | 21656 | ptrdiff_t arrow_len = SCHARS (overlay_arrow_string), nchars = 0; |
| 21657 | const unsigned char *arrow_end = arrow_string + arrow_len; | 21657 | const unsigned char *arrow_end = arrow_string + arrow_len; |
| 21658 | const unsigned char *p; | 21658 | const unsigned char *p; |
| 21659 | struct it it; | 21659 | struct it it; |
| @@ -21684,7 +21684,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) | |||
| 21684 | p += it.len; | 21684 | p += it.len; |
| 21685 | 21685 | ||
| 21686 | /* Get its face. */ | 21686 | /* Get its face. */ |
| 21687 | ilisp = make_fixnum (p - arrow_string); | 21687 | ilisp = make_fixnum (nchars++); |
| 21688 | face = Fget_text_property (ilisp, Qface, overlay_arrow_string); | 21688 | face = Fget_text_property (ilisp, Qface, overlay_arrow_string); |
| 21689 | it.face_id = compute_char_face (f, it.char_to_display, face); | 21689 | it.face_id = compute_char_face (f, it.char_to_display, face); |
| 21690 | 21690 | ||