Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: SHLVL not updated in environment



Bart Schaefer wrote:
> I think it's right, but it begs the question:  What changed from 4.2.0
> to make this fix necessary?

The code changed from "right" to "wrong".  It used to look like this.

    pm = (Param) paramtab->getnode(paramtab, "SHLVL");
    if (!(pm->flags & PM_EXPORTED))
        pm->flags |= PM_EXPORTED;
    sprintf(buf, "%d", (int)++shlvl);
    pm->env = addenv("SHLVL", buf, pm->flags);

I rationalised addenv and in my zeal I probably didn't notice that the
shlvl code wanted rationalising in a slightly different way from the
others.  The PM_EXPORTED flag is now handled within addenv().  So it
looks like the patch is correct.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author