From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21814 invoked from network); 11 Dec 2007 13:57:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Dec 2007 13:57:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 33530 invoked from network); 11 Dec 2007 13:57:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Dec 2007 13:57:00 -0000 Received: (qmail 7587 invoked by alias); 11 Dec 2007 13:56:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24210 Received: (qmail 7573 invoked from network); 11 Dec 2007 13:56:56 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 11 Dec 2007 13:56:56 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 999688058F3B for ; Tue, 11 Dec 2007 14:54:22 +0100 (CET) Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Tue, 11 Dec 2007 14:54:21 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly23d.srv.mailcontrol.com (MailControl) with ESMTP id lBBDuoYI030926 for ; Tue, 11 Dec 2007 13:56:51 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Dec 2007 13:56:50 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.1/8.13.4) with ESMTP id lBBDuo5D024176 for ; Tue, 11 Dec 2007 13:56:50 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.1/8.14.1/Submit) with ESMTP id lBBDuo5B024173 for ; Tue, 11 Dec 2007 13:56:50 GMT Message-Id: <200712111356.lBBDuo5B024173@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: "set -o foo" does not fail / does not abort the shell In-reply-to: <20071211125419.GS13079@prunille.vinc17.org> References: <20071211125419.GS13079@prunille.vinc17.org> Comments: In-reply-to Vincent Lefevre message dated "Tue, 11 Dec 2007 13:54:19 +0100." Date: Tue, 11 Dec 2007 13:56:50 +0000 From: Peter Stephenson X-OriginalArrivalTime: 11 Dec 2007 13:56:50.0333 (UTC) FILETIME=[AD7ACCD0:01C83BFD] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.68.0.133 X-Virus-Scanned: ClamAV using ClamSMTP Vincent Lefevre wrote: > I've tried the following with zsh-4.3.4-dev-4: > > $ Src/zsh -f -c 'emulate sh; set -o foo; echo "Didn''t abort ($?)"' > set: no such option: foo > Didn't abort (0) > > This is incorrect. The shell should abort as 'set' is a special > builtin[*]: This is easy. > Please check the other special builtins: > > http://www.opengroup.org/onlinepubs/009695399/idx/sbi.html This is a big job. Someone will have to volunteer for this. Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.181 diff -u -r1.181 builtin.c --- Src/builtin.c 6 Nov 2007 11:04:35 -0000 1.181 +++ Src/builtin.c 11 Dec 2007 13:08:10 -0000 @@ -567,9 +567,9 @@ return 0; } if(!(optno = optlookup(*args))) - zwarnnam(nam, "no such option: %s", *args); + zerrnam(nam, "no such option: %s", *args); else if(dosetopt(optno, action, 0)) - zwarnnam(nam, "can't change option: %s", *args); + zerrnam(nam, "can't change option: %s", *args); break; } else if(**args == 'A') { if(!*++*args) @@ -588,13 +588,15 @@ sort = action ? 1 : -1; else { if (!(optno = optlookupc(**args))) - zwarnnam(nam, "bad option: -%c", **args); + zerrnam(nam, "bad option: -%c", **args); else if(dosetopt(optno, action, 0)) - zwarnnam(nam, "can't change option: -%c", **args); + zerrnam(nam, "can't change option: -%c", **args); } } args++; } + if (errflag) + return 1; doneoptions: inittyptab(); -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070