From 872696f7819f20eb5fdaa53c16221cf614952eb7 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 1 Oct 2007 14:18:42 +0000 Subject: Pass attributes around as flags rather than as a list of escape codes. --- input.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index a77a4cd4..31bfd7ce 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.14 2007-09-30 13:29:28 nicm Exp $ */ +/* $Id: input.c,v 1.15 2007-10-01 14:18:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -953,20 +953,13 @@ input_handle_sequence_sgr(struct input_ctx *ictx) uint16_t m; n = ARRAY_LENGTH(&ictx->args); - - input_store_zero(ictx->b, CODE_ATTRIBUTES); if (n == 0) { ictx->s->attr = 0; ictx->s->colr = SCREEN_DEFCOLR; - input_store16(ictx->b, 1); - input_store16(ictx->b, 0); } else { - input_store16(ictx->b, n); for (i = 0; i < n; i++) { - if (input_get_argument(ictx, i, &m, 0) != 0) { - /* XXX XXX partial write to client */ + if (input_get_argument(ictx, i, &m, 0) != 0) return; - } switch (m) { case 0: case 10: @@ -1031,9 +1024,9 @@ input_handle_sequence_sgr(struct input_ctx *ictx) ictx->s->colr |= 0x08; break; } - input_store16(ictx->b, m); } } + input_store_two(ictx->b, CODE_ATTRIBUTES, ictx->s->attr, ictx->s->colr); } void -- cgit