[8329] in Athena Bugs
Re: rt 7.3M: enscript
daemon@ATHENA.MIT.EDU (Calvin Clark)
Fri Oct 4 12:30:52 1991
Date: Fri, 4 Oct 91 12:31:23 -0400
From: Calvin Clark <ckclark@Athena.MIT.EDU>
To: bugs@Athena.MIT.EDU
Cc: marc@Athena.MIT.EDU
Reply-To: ckclark@mit.edu
In-Reply-To: [8324]
I submit a patch which does two things:
1. Prevents enscript from trying to print to the non-existent
printer "PostScript". It will now exec lpr without the
"-PPostScript" flag, and will print "spooling to default printer"
if the printer is not overridden explicitly on command line or
by the PRINTER environment variable. (I would have added a
hes_resolve() so that the actual default printer name would
be printed, but it's not worth it.)
2. Makes enscript use the PRINTER environment variable rather than the
LPDEST environment variable if SYSV is defined, since there's no reason
to confuse users by having a different environment variable on
SYSV-based machines than on others. Currently, we are not running
our version of enscript on the RS/6000; we are running the
vendor provided version instead.
The vendor version is nearly identical to the one in the source tree:
RS/6000:
Oct 4 (12:15) splat:~
[21]% strings /usr/bin/enscript | grep Header
$Header: enscript.c,v 2.2 87/11/17 16:49:37 byron Rel $
$Header: psutil.c,v 2.2 87/11/17 16:52:49 byron Rel $
$Header: mapname.c,v 2.2 87/11/17 16:50:02 byron Rel $
VAX:
Oct 4 (12:16) hal-2000:~
[142]% strings /usr/athena/bin/enscript | grep Header
$Header: enscript.c,v 2.2 87/11/17 16:49:37 byron Rel $
$Header: psutil.c,v 2.2 87/11/17 16:52:49 byron Rel $
The difference is that the RS/6000 version is compiled with SYSV
defined, and thus is using LPDEST rather than PRINTER. This is
inconsistent, since we're running *our* lpr on the RS/6000, which *does*
read PRINTER, and *not* LPDEST. It seems reasonable that we should try
to run the same version of enscript on all of our platforms in the
future.
Enough said. -Calvin
*** /source/third/common/transcript-v2.1/src/enscript.c Tue Nov 17 19:47:33 1987
--- enscript.c Fri Oct 4 11:59:42 1991
***************
*** 81,87 ****
*
*/
! #define POSTSCRIPTPRINTER "PostScript"
#define BODYROMAN "Courier"
#define HEADFONT "Courier-Bold"
--- 81,87 ----
*
*/
! #define POSTSCRIPTPRINTER "default printer"
#define BODYROMAN "Courier"
#define HEADFONT "Courier-Bold"
***************
*** 957,967 ****
#ifdef SYSV
addarg(argstr, "-c", &nargs);
! if ((PrinterName == NULL) && ((PrinterName = envget("LPDEST")) == NULL)) {
PrinterName = POSTSCRIPTPRINTER;
}
- VOIDC sprintf(temparg,"-d%s",PrinterName);
- addarg(argstr, temparg, &nargs);
if (!BeQuiet) fprintf(stderr,"spooled to %s\n",PrinterName);
if (spoolNotify) {
--- 957,968 ----
#ifdef SYSV
addarg(argstr, "-c", &nargs);
! if ((PrinterName == NULL) && ((PrinterName = envget("PRINTER")) == NULL))
PrinterName = POSTSCRIPTPRINTER;
+ else {
+ VOIDC sprintf(temparg,"-d%s",PrinterName);
+ addarg(argstr, temparg, &nargs);
}
if (!BeQuiet) fprintf(stderr,"spooled to %s\n",PrinterName);
if (spoolNotify) {
***************
*** 992,1002 ****
VOIDC sprintf(temparg,"-#%s",spoolCopies);
addarg(argstr, temparg, &nargs);
}
! if ((PrinterName == NULL) && ((PrinterName = envget("PRINTER")) == NULL)){
PrinterName = POSTSCRIPTPRINTER;
}
- VOIDC sprintf(temparg,"-P%s",PrinterName);
- addarg(argstr, temparg, &nargs);
if (!BeQuiet) fprintf(stderr,"spooled to %s\n",PrinterName);
if (spoolJobClass) {
--- 993,1004 ----
VOIDC sprintf(temparg,"-#%s",spoolCopies);
addarg(argstr, temparg, &nargs);
}
! if ((PrinterName == NULL) && ((PrinterName = envget("PRINTER")) == NULL))
PrinterName = POSTSCRIPTPRINTER;
+ else {
+ VOIDC sprintf(temparg,"-P%s",PrinterName);
+ addarg(argstr, temparg, &nargs);
}
if (!BeQuiet) fprintf(stderr,"spooled to %s\n",PrinterName);
if (spoolJobClass) {