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

PATCH: Re: 3.0.6 SEGV in unset PATH; export PATH



On Oct 4, 11:06am, Patrik Hagglund wrote:
} Subject: 3.0.6 SEGV in unset PATH; export PATH
}
} (gdb) bt
} #0  0x4c3e4 in mkenvstr ()

Patch below.  However, the behavior is not the same as 3.1.6 in this case:

    unset PATH ; export PATH=/bin:/usr/bin

In 3.0.6 this sets $path to (/bin /usr/bin) and $PATH to /bin:/usr/bin, but
in 3.1.6 it sets only $PATH.  Is it intentional that the tied parameter got
uncoupled that way?

Index: Src/builtin.c
===================================================================
@@ -2861,7 +2861,7 @@
 	    pm->ct = auxlen;
 	if (PM_TYPE(pm->flags) != PM_ARRAY) {
 	    if (pm->flags & PM_EXPORTED) {
-		if (!pm->env)
+		if (!(pm->flags & PM_UNSET) && !pm->env)
 		    pm->env = addenv(pname, value ? value : getsparam(pname));
 	    } else if (pm->env) {
 		delenv(pm->env);

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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