1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

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>.
This commit is contained in:
Eli Zaretskii 2022-04-21 23:18:42 +03:00
parent e93e31c895
commit 5fe7e4d1ae

View file

@ -21653,7 +21653,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
struct buffer *buffer = XBUFFER (w->contents);
struct buffer *old = current_buffer;
const unsigned char *arrow_string = SDATA (overlay_arrow_string);
ptrdiff_t arrow_len = SCHARS (overlay_arrow_string);
ptrdiff_t arrow_len = SCHARS (overlay_arrow_string), nchars = 0;
const unsigned char *arrow_end = arrow_string + arrow_len;
const unsigned char *p;
struct it it;
@ -21684,7 +21684,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
p += it.len;
/* Get its face. */
ilisp = make_fixnum (p - arrow_string);
ilisp = make_fixnum (nchars++);
face = Fget_text_property (ilisp, Qface, overlay_arrow_string);
it.face_id = compute_char_face (f, it.char_to_display, face);