Date: Fri, 9 May 1997 02:50:04 -0700 (PDT) From: j@uriah.heep.sax.de (J Wunsch) To: freebsd-bugs Subject: Re: bin/3556: Bug with -i option in /usr/bin/lpr Message-ID: <199705090950.CAA24096@hub.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/3556; it has been noted by GNATS.
From: j@uriah.heep.sax.de (J Wunsch)
To: lbnstn@lili.uni-bielefeld.de
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/3556: Bug with -i option in /usr/bin/lpr
Date: Fri, 9 May 1997 10:59:58 +0200
As lbnstn@lili.uni-bielefeld.de wrote:
> There seems to be a bug in /usr/bin/lpr:
> If lpr is invoked with -i but no argument to -i is supplied, then
> then getopt eats up the argument following -i.
That's not a bug. If there's something after -i, well, by definition,
this _is_ the argument to -i.
> --- 200,214 ----
>
> case 'i': /* indent output */
> iflag++;
> ! indent = strtol (optarg, &p, 10);
> ! /* if optarg is not a valid number we assume */
> ! /* it is another option or a filename */
> ! if (*p != '\0')
> ! {
> ! indent = 8;
> ! optreset = 1;
> ! optind--;
> ! }
I agree that the validity of the argument should be checked, but lpr
shouldn't make any assumptions but simply bail out with a usage error.
Trying to be smart and `think' on behalf of the failing user is not
TRT.
--
cheers, J"org
joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705090950.CAA24096>
