From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3757 invoked by alias); 10 Jan 2015 20:04:17 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34219 Received: (qmail 228 invoked from network); 10 Jan 2015 20:04:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=CoYIqc8G c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=XqT5crv0K1fORrtTOugA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150110120412.ZM21448@torch.brasslantern.com> Date: Sat, 10 Jan 2015 12:04:12 -0800 In-reply-to: Comments: In reply to Mikael Magnusson "Re: Crash when exporting scalar without value and getsparam fails" (Jan 10, 8:10pm) References: <150109225231.ZM24510@torch.brasslantern.com> <150110092530.ZM28263@torch.brasslantern.com> <150110102827.ZM28394@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: Crash when exporting scalar without value and getsparam fails MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.