From: Kim F. Storm Date: Mon, 17 Jan 2005 08:28:28 +0000 (+0000) Subject: (mode_line_string, marginal_area_string): Fix X-Git-Tag: ttn-vms-21-2-B4~2713 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cfde341f3bf4214108cb2aede40ad6f6c1783d23;p=emacs.git (mode_line_string, marginal_area_string): Fix off-by-one error in search for glyph. --- diff --git a/src/dispnew.c b/src/dispnew.c index ff26a4dc66c..1c3c56de80b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5842,7 +5842,7 @@ mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height) it's the one we were looking for. */ glyph = row->glyphs[TEXT_AREA]; end = glyph + row->used[TEXT_AREA]; - for (x0 = *x; glyph < end && x0 > glyph->pixel_width; ++glyph) + for (x0 = *x; glyph < end && x0 >= glyph->pixel_width; ++glyph) x0 -= glyph->pixel_width; *x = glyph - row->glyphs[TEXT_AREA]; if (glyph < end) @@ -5934,7 +5934,7 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height) glyph = row->glyphs[area]; end = glyph + row->used[area]; - for (x0 = *x - x0; glyph < end && x0 > glyph->pixel_width; ++glyph) + for (x0 = *x - x0; glyph < end && x0 >= glyph->pixel_width; ++glyph) x0 -= glyph->pixel_width; *x = glyph - row->glyphs[area]; if (glyph < end)