changeset 31489:8bfcf0b562f2

(x_draw_glyphs): Handle case START and END are out of bounds more carefully.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 08 Sep 2000 09:34:24 +0000
parents f66ae09a4d4c
children bf87935c8e3d
files src/xterm.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Sep 08 09:25:16 2000 +0000
+++ b/src/xterm.c	Fri Sep 08 09:34:24 2000 +0000
@@ -4693,8 +4693,9 @@
   int i, j;
 
   /* Let's rather be paranoid than getting a SEGV.  */
+  end = min (end, row->used[area]);
   start = max (0, start);
-  end = min (end, row->used[area]);
+  start = min (end, start);
   if (real_start)
     *real_start = start;
   if (real_end)
@@ -4748,7 +4749,7 @@
   /* If there are any glyphs with lbearing < 0 or rbearing > width in
      the row, redraw some glyphs in front or following the glyph
      strings built above.  */
-  if (!overlaps_p && row->contains_overlapping_glyphs_p)
+  if (head && !overlaps_p && row->contains_overlapping_glyphs_p)
     {
       int dummy_x = 0;
       struct glyph_string *h, *t;
@@ -4847,6 +4848,7 @@
       if (area > TEXT_AREA)
 	x_reached -= window_box_width (w, TEXT_AREA);
     }
+  
   return x_reached;
 }