summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/pac
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-04 11:53:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-04 11:53:06 +0000
commit8a4b7d06ffbe850e5186e7994f245809c75d29f5 (patch)
tree430069999a3c8b72217ed4c5e2309b9808a809c5 /usr.sbin/lpr/pac
parent41825ebcd1c1b1c101667efb51ab14027456d079 (diff)
correct -P, $PRINTER, and DEFLP interactions. bug reported by scott.burns@labatt.com
Diffstat (limited to 'usr.sbin/lpr/pac')
-rw-r--r--usr.sbin/lpr/pac/pac.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c
index ac8abc21374..36e15f253f7 100644
--- a/usr.sbin/lpr/pac/pac.c
+++ b/usr.sbin/lpr/pac/pac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pac.c,v 1.3 1996/04/21 23:40:48 deraadt Exp $ */
+/* $OpenBSD: pac.c,v 1.4 1996/05/04 11:53:05 deraadt Exp $ */
/* $NetBSD: pac.c,v 1.7 1996/03/21 18:21:20 jtc Exp $ */
/*
@@ -169,8 +169,13 @@ fprintf(stderr,
(void) enter(--cp);
allflag = 0;
}
- if (printer == NULL && (printer = getenv("PRINTER")) == NULL)
+ if (printer == NULL) {
+ char *p;
+
printer = DEFLP;
+ if ((p = getenv("PRINTER"))
+ printer = p;
+ }
if (!chkprinter(printer)) {
printf("pac: unknown printer %s\n", printer);
exit(2);