From 326b33218e301bd69af0383509140136da59935c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Jul 2008 16:41:22 +0000 Subject: [PATCH] *** empty log message *** --- src/command.C | 9 ++++----- src/init.C | 5 ----- src/screen.C | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/command.C b/src/command.C index f41df70c..16c28559 100644 --- a/src/command.C +++ b/src/command.C @@ -2383,7 +2383,7 @@ rxvt_term::cmd_get8 () THROW ((class out_of_input)) FILE * rxvt_term::popen_printer () { - FILE *stream = popen (rs[Rs_print_pipe], "w"); + FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); if (stream == NULL) rxvt_warn ("can't open printer pipe, not printing.\n"); @@ -2404,17 +2404,16 @@ rxvt_term::pclose_printer (FILE *stream) void rxvt_term::process_print_pipe () { - int done; - FILE *fd; + FILE *fd = popen_printer (); - if ((fd = popen_printer ()) == NULL) + if (!fd) return; /* * Send all input to the printer until either ESC[4i or ESC[?4i * is received. */ - for (done = 0; !done;) + for (int done = 0; !done; ) { unsigned char buf[8]; unicode_t ch; diff --git a/src/init.C b/src/init.C index 6bf6bf20..ace90f42 100644 --- a/src/init.C +++ b/src/init.C @@ -461,11 +461,6 @@ rxvt_term::init_resources (int argc, const char *const *argv) if (!saveLines) set_option (Opt_scrollBar, 0); -#ifdef PRINTPIPE - if (!rs[Rs_print_pipe]) - rs[Rs_print_pipe] = PRINTPIPE; -#endif - if (!rs[Rs_cutchars]) rs[Rs_cutchars] = CUTCHARS; diff --git a/src/screen.C b/src/screen.C index 49e93386..db73ec2d 100644 --- a/src/screen.C +++ b/src/screen.C @@ -1923,9 +1923,9 @@ rxvt_term::scr_printscreen (int fullhist) NOTHROW { #ifdef PRINTPIPE int nrows, row_start; - FILE *fd; + FILE *fd = popen_printer (); - if ((fd = popen_printer ()) == NULL) + if (!fd) return; if (fullhist) -- 2.34.1