(output,screen): In ASCII mode, remove standout bit if the client
does not support standout mode. In UTF8 mode, remove SO/SI characters if the client does not support standout mode.
This commit is contained in:
parent
cee93406f9
commit
05a4eae605
1 changed files with 13 additions and 8 deletions
|
@ -326,10 +326,7 @@ output(int code, char *buf, FILE *auxfi)
|
||||||
else if (pipe_fp)
|
else if (pipe_fp)
|
||||||
fprintf(pipe_fp, "%s\n", buf);
|
fprintf(pipe_fp, "%s\n", buf);
|
||||||
else {
|
else {
|
||||||
if (SO && SE)
|
|
||||||
screen(buf);
|
screen(buf);
|
||||||
else
|
|
||||||
fputs(buf, stdout);
|
|
||||||
if (code == C_FLUSH)
|
if (code == C_FLUSH)
|
||||||
(void)fflush(stdout);
|
(void)fflush(stdout);
|
||||||
else
|
else
|
||||||
|
@ -344,12 +341,20 @@ screen(char *buf)
|
||||||
|
|
||||||
while ((c = *buf++)) {
|
while ((c = *buf++)) {
|
||||||
if (eight_bit_clean) {
|
if (eight_bit_clean) {
|
||||||
if (c == 14) fputs(SO, stdout);
|
if (c == 14) {
|
||||||
else if (c == 15) fputs(SE, stdout);
|
if (SO)
|
||||||
|
fputs(SO, stdout);
|
||||||
|
}
|
||||||
|
else if (c == 15) {
|
||||||
|
if (SE)
|
||||||
|
fputs(SE, stdout);
|
||||||
|
}
|
||||||
else putchar(c);
|
else putchar(c);
|
||||||
} else if (c & 0x80) {
|
} else if (c & 0x80) {
|
||||||
|
if (SO)
|
||||||
fputs(SO, stdout);
|
fputs(SO, stdout);
|
||||||
putchar(c & 0x7f);
|
putchar(c & 0x7f);
|
||||||
|
if (SE)
|
||||||
fputs(SE, stdout);
|
fputs(SE, stdout);
|
||||||
} else
|
} else
|
||||||
putchar(c);
|
putchar(c);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue