zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: Re: Anybody objects to the following change in createparamtable()?
Date: Thu, 27 Jul 2000 08:50:54 +0000	[thread overview]
Message-ID: <1000727085054.ZM32014@candle.brasslantern.com> (raw)
In-Reply-To: <000401bff7a2$681b5e90$21c9ca95@mow.siemens.ru>

On Jul 27, 12:12pm, Andrej Borsenkow wrote:
} Subject: Anybody objects to the following change in createparamtable()?
}
} In createparamtable() (copy environment loop):
} 
} ššif ((!(pm = (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=BAR BAZ
[schaefer@candle]$ echo $FOO
FOO
[schaefer@candle]$ printenv | grep FOO
FOO=FOO
FOO=BAR=BAZ
[schaefer@candle]$ zsh -f
zagzig% echo $ZSH_VERSION $FOO
3.0.8 FOO
zagzig% printenv | grep FOO
FOO=FOO
zagzig% 
[schaefer@candle]$ zsh-3.1.9-dev-3 -f
zagzig% echo $ZSH_VERSION $FOO
3.1.9-dev-3 BAR=BAZ                            <-- Last appears to win but
zagzig% printenv | grep FOO
FOO=FOO                                        <-- does not match environ!
zagzig% 
[schaefer@candle]$ bash
[schaefer@zagzig current]$ echo $FOO
BAR=BAZ
[schaefer@zagzig current]$ printenv | grep FOO
FOO=BAR=BAZ

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   

  reply	other threads:[~2000-07-27  8:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-27  8:12 Andrej Borsenkow
2000-07-27  8:50 ` Bart Schaefer [this message]
2000-07-27  9:13   ` Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000727085054.ZM32014@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).