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

Re: dirstack=(/) dumps core



Tanaka Akira wrote:

> I heard that assignment to dirstack may cause core dump.  I can get
> core on linux.
> 
> Z:akr@thorax% unlimit coredumpsize 
> Z:akr@thorax% zsh -f
> thorax% dirstack=(/)
> zsh: segmentation fault (core dumped)  zsh -f
> Z:akr@thorax% 

Oops.

Bye
 Sven

--- ../z.old/Src/Modules/parameter.c	Tue Feb 29 13:11:10 2000
+++ Src/Modules/parameter.c	Tue Feb 29 17:05:59 2000
@@ -967,14 +967,16 @@
 static void
 dirssetfn(Param pm, char **x)
 {
+    char **ox = x;
+
     if (!incleanup) {
 	freelinklist(dirstack, freestr);
 	dirstack = znewlinklist();
 	while (x && *x)
 	    zaddlinknode(dirstack, ztrdup(*x++));
     }
-    if (x)
-	freearray(x);
+    if (ox)
+	freearray(ox);
 }
 
 /**/

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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