From owner-freebsd-bugs Fri May 9 02:50:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA24119 for bugs-outgoing; Fri, 9 May 1997 02:50:07 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA24096; Fri, 9 May 1997 02:50:04 -0700 (PDT) Date: Fri, 9 May 1997 02:50:04 -0700 (PDT) Message-Id: <199705090950.CAA24096@hub.freebsd.org> To: freebsd-bugs Cc: From: j@uriah.heep.sax.de (J Wunsch) Subject: Re: bin/3556: Bug with -i option in /usr/bin/lpr Reply-To: j@uriah.heep.sax.de (J Wunsch) Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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. ;-)