From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8004 invoked from network); 6 Sep 2004 15:19:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Sep 2004 15:19:03 -0000 Received: (qmail 99810 invoked from network); 6 Sep 2004 15:18:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Sep 2004 15:18:57 -0000 Received: (qmail 3259 invoked by alias); 6 Sep 2004 15:18:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20324 Received: (qmail 3242 invoked from network); 6 Sep 2004 15:18:45 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Sep 2004 15:18:45 -0000 Received: (qmail 98351 invoked from network); 6 Sep 2004 15:17:46 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 6 Sep 2004 15:17:43 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i86DG5v10841 for ; Mon, 6 Sep 2004 13:16:05 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Mon, 6 Sep 2004 14:15:12 +0100 Received: from news01.csr.com ([192.168.143.38]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 6 Sep 2004 14:16:56 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.12.11/8.12.11) with ESMTP id i86DFvZA028394 for ; Mon, 6 Sep 2004 14:15:57 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.12.11/8.12.11/Submit) with ESMTP id i86DFvFC028391 for ; Mon, 6 Sep 2004 14:15:57 +0100 Message-Id: <200409061315.i86DFvFC028391@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: Any comments on users/7883 ? In-reply-to: <20040906124533.58856.qmail@web25002.mail.ukl.yahoo.com> References: <20040906124533.58856.qmail@web25002.mail.ukl.yahoo.com> Date: Mon, 06 Sep 2004 14:15:57 +0100 From: Peter Stephenson X-OriginalArrivalTime: 06 Sep 2004 13:16:56.0929 (UTC) FILETIME=[C8EA1510:01C49413] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_40 autolearn=no version=2.63 X-Spam-Hits: -0.0 =?iso-8859-1?q?Oliver=20Kiddle?= wrote: > --- Peter Stephenson wrote: > > > The error message for 'command -v blub' is now `no such builtin: -v'. > > Is that correct? I don't see any documentation for the fact that the > > -v argument isn't handled when posixbuiltins is set. > > The POSIX specification for command -v says: "Otherwise, no output > shall be written and the exit status shall reflect that the name was > not found." So it shouldn't print an error message. That's just because command -v wasn't recognised as a command with an option. It works properly when the shell gets that far. > I would have thought that -v should be handled when posixbuiltins is > set. It is only there because of POSIX to begin with. I think this is the answer. It may be just an oversight. The second hunk now doesn't get reached, but the change seems right anyway. The test hn == (HashNode)&commandbn now gets an error message about `dereferencing type-punned pointer', even though it's obviously never dereferenced. I still don't properly understand the logic here. Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.70 diff -u -r1.70 exec.c --- Src/exec.c 3 Sep 2004 09:47:49 -0000 1.70 +++ Src/exec.c 6 Sep 2004 13:15:17 -0000 @@ -1939,8 +1939,18 @@ return; } + /* + * Quit looking for a command + * - if there was an error, or + * - if we have checked that the hash entry is suitable, or + * - if we are using the command prefix and either + * - we are not using POSIXBUILTINS, or + * - we have determined there are options which would + * require us to use the command builtin. + */ if (errflag || checked || - (unset(POSIXBUILTINS) && (cflags & BINF_COMMAND))) + ((cflags & BINF_COMMAND) && + (unset(POSIXBUILTINS) || hn == (HashNode)&commandbn))) break; cmdarg = (char *) peekfirst(args); @@ -1950,7 +1960,7 @@ break; } if (!(hn = builtintab->getnode(builtintab, cmdarg))) { - if (cflags & BINF_BUILTIN) { + if ((cflags & BINF_BUILTIN) || is_builtin) { zwarn("no such builtin: %s", cmdarg, 0); lastval = 1; opts[AUTOCONTINUE] = oautocont; -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************