-/* $OpenBSD: grid.c,v 1.129 2023/06/30 21:55:08 nicm Exp $ */
+/* $OpenBSD: grid.c,v 1.130 2023/07/13 06:03:48 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
/* Default grid cell data. */
const struct grid_cell grid_default_cell = {
- { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0, 0
+ { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 8, 0
};
/*
* appears in the grid - because of this, they are always extended cells.
*/
static const struct grid_cell grid_padding_cell = {
- { { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 0, 0
+ { { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 8, 0
};
/* Cleared grid cell data. */
static const struct grid_cell grid_cleared_cell = {
- { { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0, 0
+ { { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 8, 0
};
static const struct grid_cell_entry grid_cleared_entry = {
{ .data = { 0, 8, 8, ' ' } }, GRID_FLAG_CLEARED
gc->bg = gce->data.bg;
if (gce->flags & GRID_FLAG_BG256)
gc->bg |= COLOUR_FLAG_256;
- gc->us = 0;
+ gc->us = 8;
utf8_set(&gc->data, gce->data.data);
gc->link = 0;
}
for (i = 0; i < nitems(attrs); i++) {
if (((~attr & attrs[i].mask) &&
(lastattr & attrs[i].mask)) ||
- (lastgc->us != 0 && gc->us == 0)) {
+ (lastgc->us != 8 && gc->us == 8)) {
s[n++] = 0;
lastattr &= GRID_ATTR_CHARSET;
break;
-/* $OpenBSD: tty.c,v 1.431 2023/06/26 07:17:40 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.432 2023/07/13 06:03:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
}
/* Underscore colour is set as RGB so convert. */
- gc->us = colour_force_rgb (gc->us);
- if (gc->us == -1)
+ if ((c = colour_force_rgb (gc->us)) == -1)
gc->us = 8;
+ else
+ gc->us = c;
}
static void
u_char r, g, b;
/* Clear underline colour. */
- if (gc->us == 0) {
+ if (COLOUR_DEFAULT(gc->us)) {
tty_putcode(tty, TTYC_OL);
goto save;
}