From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2703 invoked from network); 17 Nov 1998 13:14:23 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Nov 1998 13:14:23 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id IAA14736; Tue, 17 Nov 1998 08:11:55 -0500 (EST) Resent-Date: Tue, 17 Nov 1998 08:11:55 -0500 (EST) Message-Id: <9811171255.AA54479@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: PATCH: 3.1.5: unsetting special parameter Date: Tue, 17 Nov 1998 13:55:18 +0100 From: Peter Stephenson Resent-Message-ID: <"yW5nm1.0.8c3.RONKs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4662 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy