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

Re: PATCH: Re: localtraps causing core dump in 3.1.6+



On Apr 30,  3:29pm, Peter Stephenson wrote:
} Subject: Re: PATCH: Re: localtraps causing core dump in 3.1.6+
}
} dosavetrap() now always copies the trap its saving.
} 
} I've merged it round Bart's changes, which were neater than mine in some
} places, and added a minimal localtraps test.

You missed a few tidbits.

} -    if (!strncmp(nam, "TRAP", 4))
} +    if (!strncmp(nam, "TRAP", 4) && (signum = getsignum(nam +4)) != -1)
}  	hn = removetrap(getsignum(nam + 4));

--- zsh-forge/current/Src/hashtable.c	Sun Apr 30 09:56:30 2000
+++ Src/hashtable.c	Sun Apr 30 09:58:25 2000
@@ -789,8 +789,8 @@
     HashNode hn;
     int signum;
 
-    if (!strncmp(nam, "TRAP", 4) && (signum = getsignum(nam +4)) != -1)
-	hn = removetrap(getsignum(nam + 4));
+    if (!strncmp(nam, "TRAP", 4) && (signum = getsignum(nam + 4)) != -1)
+	hn = removetrap(signum);
     else
 	hn = removehashnode(shfunctab, nam);
 
--- zsh-forge/current/Src/signals.c	Sun Apr 30 09:56:30 2000
+++ Src/signals.c	Sun Apr 30 10:01:28 2000
@@ -674,7 +674,6 @@
     } else {
 	st->list = sigfuncs[sig] ? dupeprog(sigfuncs[sig], 0) : NULL;
     }
-    noerrs = !!st->list;
     if (!savetraps)
 	savetraps = znewlinklist();
     /*
@@ -731,9 +730,7 @@
 void
 unsettrap(int sig)
 {
-    int ne = noerrs;
     HashNode hn = removetrap(sig);
-    noerrs = ne;
     if (hn)
 	shfunctab->freenode(hn);
 }

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



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