From: Eli Zaretskii <eliz@gnu.org>
Date: Wed, 14 Sep 2011 05:20:23 +0000 (-0400)
Subject: xdisp.c (try_window_reusing_current_matrix): Fix incorrect computation of loop end.
X-Git-Tag: emacs-pretest-24.0.90~104^2~56
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46888499da0bb61ce47d339275d5a0c757a02eb2;p=emacs.git

xdisp.c (try_window_reusing_current_matrix): Fix incorrect computation of loop end.

 src/xdisp.c (try_window_reusing_current_matrix): Fix incorrect
 computation of loop end.  Reported by Johan Bockgård <bojohan@gnu.org>.
---

diff --git a/src/ChangeLog b/src/ChangeLog
index 9e04455102d..9f8361153a1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-14  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (try_window_reusing_current_matrix): Fix incorrect
+	computation of loop end.  Reported by Johan Bockgård
+	<bojohan@gnu.org>.
+
 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
 
 	* frame.c (Fother_visible_frames_p): Function deleted.
diff --git a/src/xdisp.c b/src/xdisp.c
index 277658fd357..3ebf7d19b1f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -16077,7 +16077,7 @@ try_window_reusing_current_matrix (struct window *w)
 	  if (row < bottom_row)
 	    {
 	      struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
-	      struct glyph *end = glyph + row->used[TEXT_AREA];
+	      struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
 
 	      /* Can't use this optimization with bidi-reordered glyph
 		 rows, unless cursor is already at point. */