comparison src/xdisp.c @ 108195:d3d8bc38d005

Fix a crash when a display string is continued to the next line. xdisp.c (set_cursor_from_row): When looping over a display string, don't overstep the end of the glyph row.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 27 Apr 2010 22:40:05 +0300
parents 65bda6b7d8b9
children c52b9f1b020e
comparison
equal deleted inserted replaced
108194:65bda6b7d8b9 108195:d3d8bc38d005
13013 cursor on that character's glyph. */ 13013 cursor on that character's glyph. */
13014 int strpos = glyph->charpos; 13014 int strpos = glyph->charpos;
13015 13015
13016 cursor = glyph; 13016 cursor = glyph;
13017 for (glyph += incr; 13017 for (glyph += incr;
13018 EQ (glyph->object, str); 13018 (row->reversed_p ? glyph > stop : glyph < stop)
13019 && EQ (glyph->object, str);
13019 glyph += incr) 13020 glyph += incr)
13020 { 13021 {
13021 Lisp_Object cprop; 13022 Lisp_Object cprop;
13022 int gpos = glyph->charpos; 13023 int gpos = glyph->charpos;
13023 13024
13054 } 13055 }
13055 13056
13056 /* If we reached the end of the line, and END was from a string, 13057 /* If we reached the end of the line, and END was from a string,
13057 the cursor is not on this line. */ 13058 the cursor is not on this line. */
13058 if (cursor == NULL 13059 if (cursor == NULL
13059 && glyph == end 13060 && (row->reversed_p ? glyph <= end : glyph >= end)
13060 && STRINGP ((glyph - incr)->object) 13061 && STRINGP (end->object)
13061 && row->continued_p) 13062 && row->continued_p)
13062 return 0; 13063 return 0;
13063 } 13064 }
13064 } 13065 }
13065 13066