* PATCH: 3.0.6-pre-3: parameter fixes
@ 1999-06-01 11:25 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-06-01 11:25 UTC (permalink / raw)
To: Zsh hackers list
These are the two parameter fixes adapted for 3.0.6: first, typeset -m
restored unset parameters which hadn't been removed from the table; second,
in fn1() { local foo; unset foo; foo=bar; }, foo is restored at local
level, while if the `unset foo' appeared in a nested function it would have
been restored at global level, which is presumably wrong, depending what
`wrong' means.
--- Src/builtin.c.pm Tue Jun 1 12:02:43 1999
+++ Src/builtin.c Tue Jun 1 12:13:26 1999
@@ -2986,6 +2986,8 @@
for (i = 0; i < paramtab->hsize; i++) {
for (pm = (Param) paramtab->nodes[i]; pm;
pm = (Param) pm->next) {
+ if (pm->flags & PM_UNSET)
+ continue;
if (domatch(pm->nam, com, 0))
addlinknode(pmlist, pm);
}
--- Src/params.c.pm Thu Apr 29 10:08:40 1999
+++ Src/params.c Tue Jun 1 12:09:28 1999
@@ -1121,7 +1121,7 @@
unsetparam_pm(altpm, 1);
}
- if ((locallevel && locallevel == pm->level) || spec) {
+ if ((pm->level && locallevel >= pm->level) || spec) {
pm->flags |= PM_UNSET;
return;
}
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-06-01 11:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-01 11:25 PATCH: 3.0.6-pre-3: parameter fixes 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).