summaryrefslogtreecommitdiff
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-12-16 19:59:50 +0200
committerEli Zaretskii <eliz@gnu.org>2013-12-16 19:59:50 +0200
commitd865f6b5554c6adf04f0786b821ba4c07c12d48d (patch)
tree63a47095ea036e9474ff1f88cef6e65aaabe0b21 /src/xdisp.c
parent062727ce6be2539bbed81af6138ad9d452002573 (diff)
Fix bug #16165 with memory corruption by extend_face_to_end_of_line.
src/xdisp.c (extend_face_to_end_of_line): Don't fill background of display margins on mode line, header line, and in the frame's tool-bar window.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index bd57dc9e27..450bf5c62d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18863,19 +18863,26 @@ extend_face_to_end_of_line (struct it *it)
it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id;
it->glyph_row->used[TEXT_AREA] = 1;
}
- if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
- && it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
- {
- it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
- it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id;
- it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
- }
- if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
- && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
+ /* Mode line and the header line don't have margins, and
+ likewise the frame's tool-bar window, if there is any. */
+ if (!(it->glyph_row->mode_line_p
+ || (WINDOWP (f->tool_bar_window)
+ && it->w == XWINDOW (f->tool_bar_window))))
{
- it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
- it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id;
- it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
+ if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+ && it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
+ {
+ it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
+ it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id;
+ it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
+ }
+ if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
+ && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
+ {
+ it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
+ it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id;
+ it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
+ }
}
#ifdef HAVE_WINDOW_SYSTEM
if (it->glyph_row->reversed_p)