Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: 3.1.5: unsetting special parameter
- X-seq: zsh-workers 4662
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: 3.1.5: unsetting special parameter
- Date: Tue, 17 Nov 1998 13:55:18 +0100
Unrelated parameters fix: the only thing I don't understand is how it
got into 3.1.5 in the first place, which usually means it was my
fault. It didn't show up in base 3.1.5 because the `if (locallevel)'
bit wasn't there, so the shell never tried to delete any parameters;
now it deletes things it shouldn't (I found this via a warning from
mem.c). This patch is against the latest version of the associative
array story, but the effect of it is necessary (though lower priority)
anyway: just replacing the offending line by hand will work.
*** Src/params.c.unset Mon Nov 16 17:34:17 1998
--- Src/params.c Tue Nov 17 13:48:08 1998
***************
*** 1558,1564 ****
* is called. Beyond that, there is an ambiguity: should *
* foo() { local bar; unset bar; } make the global bar *
* available or not? The following makes the answer "no". */
! if (locallevel && locallevel >= pm->level)
return;
paramtab->removenode(paramtab, pm->nam); /* remove parameter node from table */
--- 1558,1564 ----
* is called. Beyond that, there is an ambiguity: should *
* foo() { local bar; unset bar; } make the global bar *
* available or not? The following makes the answer "no". */
! if ((locallevel && locallevel >= pm->level) || (pm->flags & PM_SPECIAL))
return;
paramtab->removenode(paramtab, pm->nam); /* remove parameter node from table */
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author