diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-22 15:53:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-22 15:53:59 +0000 |
commit | 2d3dfde0328b40bfd84934673158795a86bf0e3c (patch) | |
tree | 40434af8e097013c509e1cbc18fbffab8a6544b7 /usr.bin | |
parent | 8fa5a363d25830cbd59c3140b86f87c907e30158 (diff) |
Clear last attributes after reset in string_cells, from George Nachman.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/grid.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 020ee276482..8719fa84dc3 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.24 2013/03/22 15:51:54 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.25 2013/03/22 15:53:58 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -511,6 +511,7 @@ grid_string_cells_code(const struct grid_cell *lastgc, for (i = 0; i < nitems(attrs); i++) { if (!(attr & attrs[i].mask) && (lastattr & attrs[i].mask)) { s[n++] = 0; + lastattr &= GRID_ATTR_CHARSET; break; } } @@ -523,7 +524,8 @@ grid_string_cells_code(const struct grid_cell *lastgc, /* If the foreground c changed, append its parameters. */ nnewc = grid_string_cells_fg(gc, newc); noldc = grid_string_cells_fg(lastgc, oldc); - if (nnewc != noldc || memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) { + if (nnewc != noldc || + memcmp(newc,oldc, nnewc * sizeof newc[0]) != 0) { for (i = 0; i < nnewc; i++) s[n++] = newc[i]; } @@ -531,7 +533,8 @@ grid_string_cells_code(const struct grid_cell *lastgc, /* If the background c changed, append its parameters. */ nnewc = grid_string_cells_bg(gc, newc); noldc = grid_string_cells_bg(lastgc, oldc); - if (nnewc != noldc || memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) { + if (nnewc != noldc || + memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) { for (i = 0; i < nnewc; i++) s[n++] = newc[i]; } |