zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: 3.1.5: unsetting special parameter
@ 1998-11-17 12:55 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1998-11-17 12:55 UTC (permalink / raw)
  To: Zsh hackers list

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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-11-17 13:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-17 12:55 PATCH: 3.1.5: unsetting special parameter 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).