Wed Feb 11 14:06:20 2004 Michael Jennings (mej)
Fixed handling of escape sequences while printing. Pointed out by Tom A. Cox <tomc@hot.rr.com>. SVN revision: 8941
This commit is contained in:
parent
020ab11571
commit
41ba8fec04
|
@ -5168,3 +5168,8 @@ Mon Jan 19 21:02:30 2004 Michael Jennings (mej)
|
|||
|
||||
Patch from David Lloyd <dmlloyd@tds.net> for overstrike support.
|
||||
----------------------------------------------------------------------
|
||||
Wed Feb 11 14:06:20 2004 Michael Jennings (mej)
|
||||
|
||||
Fixed handling of escape sequences while printing. Pointed out by
|
||||
Tom A. Cox <tomc@hot.rr.com>.
|
||||
----------------------------------------------------------------------
|
||||
|
|
15
src/term.c
15
src/term.c
|
@ -850,7 +850,6 @@ void
|
|||
process_print_pipe(void)
|
||||
{
|
||||
const char *const escape_seq = "\033[4i";
|
||||
const char *const rev_escape_seq = "i4[\033";
|
||||
int index;
|
||||
FILE *fd;
|
||||
|
||||
|
@ -858,15 +857,19 @@ process_print_pipe(void)
|
|||
for (index = 0; index < 4; /* nil */ ) {
|
||||
unsigned char ch = cmd_getc();
|
||||
|
||||
if (ch == escape_seq[index])
|
||||
if (ch == escape_seq[index]) {
|
||||
index++;
|
||||
else if (index)
|
||||
for ( /*nil */ ; index > 0; index--)
|
||||
fputc(rev_escape_seq[index - 1], fd);
|
||||
} else if (index) {
|
||||
int i;
|
||||
|
||||
if (index == 0)
|
||||
for (i = 0; index > 0; i++, index--) {
|
||||
fputc(escape_seq[i], fd);
|
||||
}
|
||||
}
|
||||
if (index == 0) {
|
||||
fputc(ch, fd);
|
||||
}
|
||||
}
|
||||
pclose_printer(fd);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue