Simplify tdeftrans

This commit is contained in:
Roberto E. Vargas Caballero 2014-06-07 13:23:45 +02:00
parent 18a05fdf43
commit 93661042a2

15
st.c
View file

@ -2315,19 +2315,14 @@ techo(char *buf, int len) {
void void
tdeftran(char ascii) { tdeftran(char ascii) {
char c, (*bp)[2]; static char cs[] = "0B";
static char tbl[][2] = { static int vcs[] = {CS_GRAPHIC0, CS_USA};
{'0', CS_GRAPHIC0}, {'B', CS_USA}, char *p;
{0, 0}
};
for (bp = &tbl[0]; (c = (*bp)[0]) && c != ascii; ++bp) if((p = strchr(cs, ascii)) == NULL)
/* nothing */;
if (c == 0)
fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii); fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii);
else else
term.trantbl[term.icharset] = (*bp)[1]; term.trantbl[term.icharset] = vcs[p - cs];
} }
void void