diff options
author | wl <wl> | 2009-01-19 08:01:59 +0000 |
---|---|---|
committer | wl <wl> | 2009-01-19 08:01:59 +0000 |
commit | d1d8ea2e49e5a2b02d1fd76133d2f60eec8fa047 (patch) | |
tree | 4715eb81b9a4bba859d0a1fa7eb6b2a9f0645b12 /src | |
parent | 5c052222e1b0aa46f95e5429a72209d02eee5cd8 (diff) | |
download | groff-d1d8ea2e49e5a2b02d1fd76133d2f60eec8fa047.tar.gz |
Fix incorrect grops color state before \X'...'.
Problem reported by Miklos Somogyi <msom@netspace.net.au>.
* src/devices/grops/ps.cpp (ps_printer::special): Check color state
before doing a PS special and flush buffer.
Update called functions.
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/grops/ps.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp index 37fd4efa..ab1b0809 100644 --- a/src/devices/grops/ps.cpp +++ b/src/devices/grops/ps.cpp @@ -1557,6 +1557,9 @@ void ps_printer::special(char *arg, const environment *env, char type) } for (unsigned int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++) if (strncmp(command, proc_table[i].name, p - command) == 0) { + flush_sbuf(); + if (sbuf_color != *env->col) + set_color(env->col); (this->*(proc_table[i].proc))(p, env); return; } @@ -1583,7 +1586,6 @@ static int check_line_lengths(const char *p) void ps_printer::do_exec(char *arg, const environment *env) { - flush_sbuf(); while (csspace(*arg)) arg++; if (*arg == '\0') { @@ -1609,7 +1611,6 @@ void ps_printer::do_exec(char *arg, const environment *env) void ps_printer::do_file(char *arg, const environment *env) { - flush_sbuf(); while (csspace(*arg)) arg++; if (*arg == '\0') { @@ -1636,7 +1637,6 @@ void ps_printer::do_file(char *arg, const environment *env) void ps_printer::do_def(char *arg, const environment *) { - flush_sbuf(); while (csspace(*arg)) arg++; if (!check_line_lengths(arg)) @@ -1652,7 +1652,6 @@ void ps_printer::do_def(char *arg, const environment *) void ps_printer::do_mdef(char *arg, const environment *) { - flush_sbuf(); char *p; int n = (int)strtol(arg, &p, 10); if (n == 0 && p == arg) { @@ -1677,7 +1676,6 @@ void ps_printer::do_mdef(char *arg, const environment *) void ps_printer::do_import(char *arg, const environment *env) { - flush_sbuf(); while (*arg == ' ' || *arg == '\n') arg++; char *p; |