From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4568 invoked from network); 7 Mar 2003 12:27:23 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Mar 2003 12:27:23 -0000 Received: (qmail 10069 invoked by alias); 7 Mar 2003 12:27:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18325 Received: (qmail 10058 invoked from network); 7 Mar 2003 12:27:17 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 7 Mar 2003 12:27:17 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 7 Mar 2003 12:27:17 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Fri, 7 Mar 2003 12:34:42 +0000 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id DQ47PZAX; Fri, 7 Mar 2003 12:27:10 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: Re: $options doesn't work for options on by default In-reply-to: "Peter Stephenson"'s message of "Fri, 07 Mar 2003 12:05:42 GMT." <21368.1047038742@csr.com> Date: Fri, 07 Mar 2003 12:27:15 +0000 Message-ID: <16751.1047040035@csr.com> From: Peter Stephenson Peter Stephenson wrote: > bad (nohup and nobeep are both set) > > % print ${options[hup]} > off > % print ${options[nohup]} > off > % print ${options[nobeep]} > off > % print ${options[beep]} > off Index: Src/Modules/parameter.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/parameter.c,v retrieving revision 1.22 diff -u -r1.22 parameter.c --- Src/Modules/parameter.c 28 Aug 2001 08:41:52 -0000 1.22 +++ Src/Modules/parameter.c 7 Mar 2003 12:26:10 -0000 @@ -794,7 +794,14 @@ pm->level = 0; if ((n = optlookup(name))) - pm->u.str = dupstring(opts[n] ? "on" : "off"); + { + int ison; + if (n > 0) + ison = opts[n]; + else + ison = !opts[-n]; + pm->u.str = dupstring(ison ? "on" : "off"); + } else { pm->u.str = dupstring(""); pm->flags |= PM_UNSET; -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************