-/* $OpenBSD: style.c,v 1.5 2015/02/18 15:32:37 nicm Exp $ */
+/* $OpenBSD: style.c,v 1.6 2015/04/15 15:44:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
{
int value;
struct grid_cell *gc;
+ struct options_entry *o;
/* It's a colour or attribute, but with no -style equivalent. */
if (newname == NULL)
return;
- gc = options_get_style(oo, newname);
- value = options_get_number(oo, name);
+ o = options_find1(oo, newname);
+ if (o == NULL)
+ o = options_set_style (oo, newname, "default", 0);
+ gc = &o->style;
+
+ o = options_find1(oo, name);
+ if (o == NULL)
+ o = options_set_number (oo, name, 8);
+ value = o->num;
if (strstr(name, "-bg") != NULL)
colour_set_bg(gc, value);