Subject: redraw_printer_select() in two source files

From: "J.J.Bailey" <[email-masked]>
Date: Mon, 29 Nov 1993 19:56:19 -0700(PDT)

I have been asked to add a printer type to pine.  While looking
through the code, I found 2 instances of redraw_printer_select().
They appear to be essentially the same.  Are they both necessary?

J.J.Bailey
Consultant
[email-masked]

---

From: Michael Seibel <[email-masked]>
Date: Mon, 29 Nov 1993 23:01:47 -0800 (PST)

Good catch!  The select_printer() and redraw_printer_select() in
pine/other.c are indeed redundant, unused and superfluous. 

Thanks for bringing this to our attention!  One has to wonder how it
slipped by us for this long... 

-mikes

---

From: Jos Vos <[email-masked]>
Date: Tue, 30 Nov 93 08:49:34 MET

> pine/other.c are indeed redundant, unused and superfluous. 

Please note that the contents of these routines in pine/other.c
are better than those of pine/pine.c: in the other.c version the
System V-specific LPDEST and lp things are mentioned, while in
the pine.c version only BSD's PRINTER and lpr is listed.

I alread posted a patch for this to this mailing list months ago:

To: Pine Info <[email-masked]>
Subject: Patch for Printer setup screen
Date: Thu, 21 Oct 93 17:32:42 MET
From: Jos Vos <[email-masked]>

In the file other.c and pine.c two functionally equivalent (static)
functions redraw_printer_select() exist.
The text included in other.c was more generic (it contained also references
to "lp" and "LPDEST", thus being more appropriate for System V systems).

So I made the following patch to make the text in pine.c equal to
that in other.c.

Please include this patch in the next official release.

------CUT HERE-----
*** pine/pine.c.orig	Tue Oct 12 16:48:52 1993
--- pine/pine.c	Wed Oct 20 10:26:50 1993
***************
*** 1430,1437 ****
              rc = set_variable(V_PERSONAL_PRINT_COMMAND, custom_command);
          }
          if(rc == 0)
!           q_status_message1(0,1,3, "Printer set to \"%s\"; configuration saved",
!                             ps_global->VAR_PRINTER);
      }
  }
  
--- 1430,1438 ----
              rc = set_variable(V_PERSONAL_PRINT_COMMAND, custom_command);
          }
          if(rc == 0)
!           q_status_message1(0, 1, 3,
! 				  "Printer set to \"%s\"; configuration saved",
! 				  ps_global->VAR_PRINTER);
      }
  }
  
***************
*** 1468,1475 ****
      l++;
      PutLine0(l++, 3, "2. Standard UNIX print command");
      PutLine0(l++,6,
!         "Using this option may require setting your \"PRINTER\" environment");
!     PutLine0(l++, 6,    "variable using the standard UNIX utilities.");
      PutLine0(l, 10 , "Command: ");
      if(ps_global->VAR_STANDARD_PRINTER != NULL &&
         strcmp(ps_global->VAR_PRINTER, ps_global->VAR_STANDARD_PRINTER) == 0) {
--- 1469,1477 ----
      l++;
      PutLine0(l++, 3, "2. Standard UNIX print command");
      PutLine0(l++,6,
!        "Using this option may require setting your \"PRINTER\" or \"LPDEST\"");
!     PutLine0(l++, 6,    
!        "environment variable using the standard UNIX utilities.");
      PutLine0(l, 10 , "Command: ");
      if(ps_global->VAR_STANDARD_PRINTER != NULL &&
         strcmp(ps_global->VAR_PRINTER, ps_global->VAR_STANDARD_PRINTER) == 0) {
***************
*** 1488,1498 ****
      PutLine0(l++, 6,
        "The text to be printed will be piped into the command given here. Some");
      PutLine0(l++, 6,
!       "examples are: \"prt\", \"lpr\", or \"enscript\". The command may be given");
      PutLine0(l++, 6,
        "with options, for example \"enscript -2 -r\" or \"lpr -Plpacc170\". The");
      PutLine0(l++, 6,
!       "commands and options on your system may be different these examples.");
      PutLine0(l, 10,  "Command: ");
      if(!matched_printer)  
        StartInverse();
--- 1490,1500 ----
      PutLine0(l++, 6,
        "The text to be printed will be piped into the command given here. Some");
      PutLine0(l++, 6,
!       "examples are: \"prt\", \"lpr\", \"lp\", or \"enscript\". The command may be given");
      PutLine0(l++, 6,
        "with options, for example \"enscript -2 -r\" or \"lpr -Plpacc170\". The");
      PutLine0(l++, 6,
!       "commands and options on your system may be different from these examples.");
      PutLine0(l, 10,  "Command: ");
      if(!matched_printer)  
        StartInverse();
------CUT HERE-----

-- 
--    Jos Vos <[email-masked]>   (UUCP: ...!{uunet,mcsun,sun4nl}!nlbull!jos)
--    Bull Netherlands, Professional Services, Amsterdam, The Netherlands

---

From: "J.J.Bailey" <[email-masked]>
Date: Tue, 30 Nov 1993 10:33:19 -0700(PDT)

> the pine.c version only BSD's PRINTER and lpr is listed.
  ...
> So I made the following patch to make the text in pine.c equal to

The fix I had in mind was to remove the redundancy, i.e. remove the
function from pine/pine.c, and change the other function from static to
global.

---

From: Jos Vos <[email-masked]>
Date: Wed, 01 Dec 93 08:38:41 MET

> function from pine/pine.c, and change the other function from static to

That's OK: the function in other.c is the best one.