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

Re: Wordcode functions with empty bodies



> In principle, the trap test should already pick this sort of thing up, it
> just didn't crash often enough.  More DPUTS()'s are probably the answer to
> similar future problems.

Even so, it might be better to add this.  Does anyone have a better
version?

By the way, this answers a previous question of Bart's --- function traps
should be removed from the function table when localtraps is set.

Index: Test/08traps.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/08traps.ztst,v
retrieving revision 1.3
diff -u -r1.3 08traps.ztst
--- Test/08traps.ztst	2000/05/04 11:46:20	1.3
+++ Test/08traps.ztst	2000/06/14 15:15:18
@@ -175,3 +175,12 @@
 >testunset
 >f
 >ERR-or!
+
+  f() {
+    setopt localtraps
+    TRAPWINCH() { print "Window changed.  That wrecked the test."; }
+  }
+  f
+  f
+  functions TRAPWINCH
+1:Unsetting ordinary traps with localtraps.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



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