(getsose): Port from obsolete termcap to terminfo. The old code
manually stripped off padding, which is evil. The new code does nothing when the stdout is not connected to a terminal. (SO, smso, SE, rmso): Rename, static linkage. (putso, putse): New. (screen): Use it.
This commit is contained in:
parent
c3915edb54
commit
fbf9f15bbb
3 changed files with 48 additions and 62 deletions
|
@ -341,21 +341,16 @@ screen(char *buf)
|
|||
|
||||
while ((c = *buf++)) {
|
||||
if (eight_bit_clean) {
|
||||
if (c == 14) {
|
||||
if (SO)
|
||||
fputs(SO, stdout);
|
||||
}
|
||||
else if (c == 15) {
|
||||
if (SE)
|
||||
fputs(SE, stdout);
|
||||
}
|
||||
else putchar(c);
|
||||
if (c == 14)
|
||||
putso();
|
||||
else if (c == 15)
|
||||
putse();
|
||||
else
|
||||
putchar(c);
|
||||
} else if (c & 0x80) {
|
||||
if (SO)
|
||||
fputs(SO, stdout);
|
||||
putso();
|
||||
putchar(c & 0x7f);
|
||||
if (SE)
|
||||
fputs(SE, stdout);
|
||||
putse();
|
||||
} else
|
||||
putchar(c);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue