diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-12-06 13:54:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-12-06 13:54:33 +0000 |
commit | 08d7be638e15cd656cff3baba39eabe36959e06c (patch) | |
tree | e5b780784e738ea964d66d81a12965c496813dd0 | |
parent | 194c8716113c22ece825492587347d9364c92ef2 (diff) |
Fix charset stuff.
-rw-r--r-- | input.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.44 2007-12-06 09:46:22 nicm Exp $ */ +/* $Id: input.c,v 1.45 2007-12-06 13:54:33 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -488,6 +488,7 @@ void input_handle_c0_control(u_char ch, struct input_ctx *ictx) { struct screen *s = ictx->ctx.s; + u_char attr; log_debug2("-- c0 %zu: %hhu", ictx->off, ch); @@ -515,12 +516,12 @@ input_handle_c0_control(u_char ch, struct input_ctx *ictx) screen_write_move_cursor(&ictx->ctx, s->cx, s->cy); break; case '\016': /* SO */ - s->attr |= ATTR_CHARSET; - screen_write_set_attributes(&ictx->ctx, s->attr, s->colr); + attr = s->attr | ATTR_CHARSET; + screen_write_set_attributes(&ictx->ctx, attr, s->colr); break; case '\017': /* SI */ - s->attr &= ~ATTR_CHARSET; - screen_write_set_attributes(&ictx->ctx, s->attr, s->colr); + attr = s->attr & ~ATTR_CHARSET; + screen_write_set_attributes(&ictx->ctx, attr, s->colr); break; default: log_debug("unknown c0: %hhu", ch); @@ -567,12 +568,9 @@ input_handle_private_two(u_char ch, struct input_ctx *ictx) case '8': /* DECRC */ if (!(s->mode & MODE_SAVED)) break; - s->cx = s->saved_cx; - s->cy = s->saved_cy; - s->attr = s->saved_attr; - s->colr = s->saved_colr; - screen_write_set_attributes(&ictx->ctx, s->attr, s->colr); - screen_write_move_cursor(&ictx->ctx, s->cx, s->cy); + screen_write_set_attributes( + &ictx->ctx, s->saved_attr, s->saved_colr); + screen_write_move_cursor(&ictx->ctx, s->saved_cx, s->saved_cy); break; default: log_debug("unknown p2: %hhu", ch); |