zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Crash when exporting scalar without value and getsparam fails
Date: Sat, 10 Jan 2015 12:04:12 -0800	[thread overview]
Message-ID: <150110120412.ZM21448@torch.brasslantern.com> (raw)
In-Reply-To: <CAHYJk3TUcEJszbWPJ=qATndb_vFx8tcyHL1+-V=7miPxBTyKmA@mail.gmail.com>

On Jan 10,  8:10pm, Mikael Magnusson wrote:
}
} % unset IFS
} % export IFS
} % IFS=5
} % unset IFS
} % printenv|grep IFS # this would be empty for a normal parameter
} IFS=5

OK, so the remaining issue is that the PM_EXPORT flag is not cleared
when a special parameter is unset.

I think this is within the definition of how a special paramter behaves;
i.e., it retains all its attributes even when unset.  In this case we
have an attribute that's not normally "part of the specialness" of the
parameter, which is also being preserved.  The same thing happens with
other flags on other specials, e.g.:

torch% print $SECONDS
762
torch% typeset -E SECONDS
torch% print $SECONDS    
7.801753190e+02
torch% unset SECONDS
torch% print $SECONDS

torch% SECONDS=763
torch% print $SECONDS
7.671235090e+02


So should e.g. stdunsetfn() and tiedarrunsetfn() clear the PM_EXPORTED
flag as well as assert the PM_UNSET flag?  Or is that going to cause a
problem elsewhere because there is a special parameter that has the
feature of always being exported?  I can't think of any, but maybe we
shouldn't rule it out ... in which case this gets really hairy, as we
will have to know, for every special, what flags should or should not
be retained across unset.


  reply	other threads:[~2015-01-10 20:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 13:26 Mikael Magnusson
2015-01-10  6:52 ` Bart Schaefer
2015-01-10  7:56   ` Mikael Magnusson
2015-01-10  8:09     ` Mikael Magnusson
2015-01-10 17:25       ` Bart Schaefer
2015-01-10 18:28         ` Bart Schaefer
2015-01-10 19:10           ` Mikael Magnusson
2015-01-10 20:04             ` Bart Schaefer [this message]
2015-01-10 20:28               ` Mikael Magnusson
2015-01-10 16:57     ` Bart Schaefer
2015-01-10 17:12       ` Mikael Magnusson

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=150110120412.ZM21448@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).