diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-05-31 15:39:18 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-05-31 15:39:18 -0700 |
commit | 52826d55e94628ef9bc119588cf7982209035796 (patch) | |
tree | cd50bb15aa6cfe48d7dd2ef52c02d69b433b3aeb | |
parent | fd3e9d641be663cd2263fa5affd8f03f795ee5c6 (diff) | |
download | syslinux-52826d55e94628ef9bc119588cf7982209035796.tar.gz |
ansi.c: minor cleanups
-rw-r--r-- | com32/lib/sys/ansi.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/com32/lib/sys/ansi.c b/com32/lib/sys/ansi.c index 10042994..27975ddc 100644 --- a/com32/lib/sys/ansi.c +++ b/com32/lib/sys/ansi.c @@ -82,7 +82,7 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch) switch ( ch ) { case 1 ... 5: st->state = st_tbl; - st->tbl_chars = ch; + st->parms[0] = ch; break; case '\b': if ( xy.x > 0 ) xy.x--; @@ -376,7 +376,7 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch) break; case st_tbl: - st->parms[0] = 0; + st->parms[1] = 0; if ( ch == '#' ) st->state = st_tblc; else @@ -389,22 +389,24 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch) const char *p; if (n < 10) { - st->parms[0] = st->parms[0]*10+n; + st->parms[1] = st->parms[1]*10+n; - if (! --st->tbl_chars) { - if (st->parms[0] < console_color_table_size) { + if (! --st->parms[0]) { + if (st->parms[1] < console_color_table_size) { /* Set the color table index */ - st->cindex = st->parms[0]; - + st->cindex = st->parms[1]; + /* See if there are any other attributes we care about */ - p = console_color_table[st->parms[0]].ansi; - st->state = st_esc; - __ansi_putchar(ti, '['); - __ansi_putchar(ti, '0'); - __ansi_putchar(ti, ';'); - while (*p) - __ansi_putchar(ti, *p++); - __ansi_putchar(ti, 'm'); + p = console_color_table[st->parms[1]].ansi; + if (p) { + st->state = st_esc; + __ansi_putchar(ti, '['); + __ansi_putchar(ti, '0'); + __ansi_putchar(ti, ';'); + while (*p) + __ansi_putchar(ti, *p++); + __ansi_putchar(ti, 'm'); + } } st->state = st_init; } |