* $options doesn't work for options on by default
@ 2003-03-07 12:05 Peter Stephenson
2003-03-07 12:27 ` PATCH: " Peter Stephenson
0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2003-03-07 12:05 UTC (permalink / raw)
To: Zsh hackers list
good
% print ${options[notify]}
on
% print ${options[nonotify]}
off
bad (nohup and nobeep are both set)
% print ${options[hup]}
off
% print ${options[nohup]}
off
% print ${options[nobeep]}
off
% print ${options[beep]}
off
--
Peter Stephenson <pws@csr.com> 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.
**********************************************************************
^ permalink raw reply [flat|nested] 2+ messages in thread
* PATCH: Re: $options doesn't work for options on by default
2003-03-07 12:05 $options doesn't work for options on by default Peter Stephenson
@ 2003-03-07 12:27 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2003-03-07 12:27 UTC (permalink / raw)
To: Zsh hackers list
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@csr.com> 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.
**********************************************************************
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-07 12:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-07 12:05 $options doesn't work for options on by default Peter Stephenson
2003-03-07 12:27 ` PATCH: " Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).