*** empty log message ***
authorroot <root>
Tue, 15 Jul 2008 16:41:22 +0000 (16:41 +0000)
committerroot <root>
Tue, 15 Jul 2008 16:41:22 +0000 (16:41 +0000)
src/command.C
src/init.C
src/screen.C

index f41df70cdffc5fcc4561023692d99d8cce689221..16c28559785ccc92ff0605aacfb1a6e58091f49b 100644 (file)
@@ -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;
index 6bf6bf20bc51355362366ca2c95f8774197a8467..ace90f42251f707882083ed2ae4dea85a44e7b5e 100644 (file)
@@ -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;
 
index 49e93386aaba66cad64328f32c955906bfe2db0e..db73ec2dc1603a85e9182c8a07a6decb5b83d754 100644 (file)
@@ -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)