]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a crash when a display string is continued to the next line.
authorEli Zaretskii <eliz@gnu.org>
Tue, 27 Apr 2010 19:40:05 +0000 (22:40 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 27 Apr 2010 19:40:05 +0000 (22:40 +0300)
 xdisp.c (set_cursor_from_row): When looping over a display string,
 don't overstep the end of the glyph row.

src/ChangeLog
src/xdisp.c

index 9cabe8de38b5353e7cbaa81fb5213300f2b6c3b1..a6a89a4ea3b948e525cc753fdb67670f2b2dc0ce 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-27  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (set_cursor_from_row): Fix a crash when a display string
+       is continued to the next line.
+
 2010-04-25  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (set_cursor_from_row): Don't return zero if cursor was
index d491d5a9aebc21bf4b99d6f0d519e50f26fd7b62..9e14f7879a20a531018f16c301f2b207f89ddbdb 100644 (file)
@@ -13015,7 +13015,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
 
                          cursor = glyph;
                          for (glyph += incr;
-                              EQ (glyph->object, str);
+                              (row->reversed_p ? glyph > stop : glyph < stop)
+                                && EQ (glyph->object, str);
                               glyph += incr)
                            {
                              Lisp_Object cprop;
@@ -13056,8 +13057,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
          /* If we reached the end of the line, and END was from a string,
             the cursor is not on this line.  */
          if (cursor == NULL
-             && glyph == end
-             && STRINGP ((glyph - incr)->object)
+             && (row->reversed_p ? glyph <= end : glyph >= end)
+             && STRINGP (end->object)
              && row->continued_p)
            return 0;
        }