From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24130 invoked from network); 1 Jun 1999 11:53:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Jun 1999 11:53:38 -0000 Received: (qmail 23042 invoked by alias); 1 Jun 1999 11:53:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6419 Received: (qmail 23034 invoked from network); 1 Jun 1999 11:53:08 -0000 Message-Id: <9906011125.AA14818@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: 3.0.6-pre-3: parameter fixes Date: Tue, 01 Jun 1999 13:25:33 +0200 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy