From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10449 invoked from network); 27 Jul 2000 08:51:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jul 2000 08:51:27 -0000 Received: (qmail 12728 invoked by alias); 27 Jul 2000 08:51:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12401 Received: (qmail 12720 invoked from network); 27 Jul 2000 08:51:06 -0000 From: "Bart Schaefer" Message-Id: <1000727085054.ZM32014@candle.brasslantern.com> Date: Thu, 27 Jul 2000 08:50:54 +0000 In-Reply-To: <000401bff7a2$681b5e90$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "Anybody objects to the following change in createparamtable()?" (Jul 27, 12:12pm) References: <000401bff7a2$681b5e90$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "ZSH workers mailing list" Subject: Re: Anybody objects to the following change in createparamtable()? MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On Jul 27, 12:12pm, Andrej Borsenkow wrote: } Subject: Anybody objects to the following change in createparamtable()?= } } In createparamtable() (copy environment loop): } = } =9A=9Aif ((!(pm =3D (Param) paramtab->getnode(paramtab, iname)) || Where'd those '\232' characters come from? Please don't let any of those= creep into the actual source code ... } The reason is, if we have duplicated environment entries, last one } wins and call to setsparam() will try to modify environment in the } middle of traversing it. I'd prefer, if check for PM_EXPORTED comes } first - if parameter is already exported, just skip any environment } with the same name. This is probably OK. Take a look at this (ignore zsh vs. tcsh hostname confusion): zagzig[267] tcsh [schaefer@candle]$ setenv FOO FOO [schaefer@candle]$ echo $FOO FOO [schaefer@candle]$ setenv FOO=3DBAR BAZ [schaefer@candle]$ echo $FOO FOO [schaefer@candle]$ printenv | grep FOO FOO=3DFOO FOO=3DBAR=3DBAZ [schaefer@candle]$ zsh -f zagzig% echo $ZSH_VERSION $FOO 3.0.8 FOO zagzig% printenv | grep FOO FOO=3DFOO zagzig% = [schaefer@candle]$ zsh-3.1.9-dev-3 -f zagzig% echo $ZSH_VERSION $FOO 3.1.9-dev-3 BAR=3DBAZ <-- Last appears to win = but zagzig% printenv | grep FOO FOO=3DFOO <-- does not match envir= on! zagzig% = [schaefer@candle]$ bash [schaefer@zagzig current]$ echo $FOO BAR=3DBAZ [schaefer@zagzig current]$ printenv | grep FOO FOO=3DBAR=3DBAZ So we have zsh-3.0.8 where the first one wins consistently, and bash where the last one wins consistently, and zsh-3.1.9-dev-3 which does not behave consistently at all. } At this point the only exported parameters are the ones resulted from } importing environment so it should be safe. This all depends on your definition of "safe" ... -- = Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net = =