summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1997-02-26 02:22:45 +0000
committermpp <mpp@FreeBSD.org>1997-02-26 02:22:45 +0000
commit1cccbbea7224813f2f43fe5d50f2c8e3a0a6e030 (patch)
tree9156213f290e473295b922449dd18bc0ff0861ac /usr.sbin/lpr
parent2e0efc5be6073320e1cfe8733a8520a06bb64b9d (diff)
downloadFreeBSD-src-1cccbbea7224813f2f43fe5d50f2c8e3a0a6e030.zip
FreeBSD-src-1cccbbea7224813f2f43fe5d50f2c8e3a0a6e030.tar.gz
Fix an off by one error when determing the default job name for
the banner page. Closes PR# 1986. Submitted by: Mark Valentine <mark@linus.demon.co.uk>
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/lpr/lpr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index 1e6b92c..0ba3725 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -45,7 +45,7 @@ static char copyright[] =
#ifndef lint
static char sccsid[] = "From: @(#)lpr.c 8.4 (Berkeley) 4/28/95"
- "\n$Id$\n";
+ "\n$Id: lpr.c,v 1.12 1997/02/22 16:06:20 peter Exp $\n";
#endif /* not lint */
/*
@@ -76,7 +76,7 @@ static char sccsid[] = "From: @(#)lpr.c 8.4 (Berkeley) 4/28/95"
static char *cfname; /* daemon control files, linked from tf's */
static char *class = host; /* class title on header page */
-static char *dfname; /* data files */
+static char *dfname; /* data files */
static char *fonts[4]; /* troff font names */
static char format = 'f'; /* format char for printing files */
static int hdr = 1; /* print header or not (default is yes) */
@@ -285,10 +285,10 @@ main(argc, argv)
card('P', person);
if (hdr) {
if (jobname == NULL) {
- if (argc == 1)
+ if (argc == 0)
jobname = "stdin";
else
- jobname = (arg = rindex(argv[1], '/')) ? arg+1 : argv[1];
+ jobname = (arg = rindex(argv[0], '/')) ? arg+1 : argv[0];
}
card('J', jobname);
card('C', class);
OpenPOWER on IntegriCloud