Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: $options doesn't work for options on by default
- X-seq: zsh-workers 18325
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: Re: $options doesn't work for options on by default
- Date: Fri, 07 Mar 2003 12:27:15 +0000
- In-reply-to: "Peter Stephenson"'s message of "Fri, 07 Mar 2003 12:05:42 GMT." <21368.1047038742@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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 <pws@xxxxxxx> 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.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author