From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17901 invoked from network); 9 Jan 1998 11:34:14 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 9 Jan 1998 11:34:14 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id GAA23723; Fri, 9 Jan 1998 06:10:00 -0500 (EST) Resent-Date: Fri, 9 Jan 1998 06:10:00 -0500 (EST) Sender: rz2a022@rrz.uni-hamburg.de Message-ID: <34B605D7.28EA4ABF@rrz.uni-hamburg.de> Date: Fri, 09 Jan 1998 12:11:19 +0100 From: Bernd Eggink Organization: RRZ Uni Hamburg X-Mailer: Mozilla 4.03 [en] (X11; I; AIX 4.1) MIME-Version: 1.0 To: zsh-workers mailing list Subject: Trap bug? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-ID: <"f4Phh3.0.co5.8MWjq"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3679 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu This doesn't work correctly in 3.1.2: function f { ( trap 'print "INT f"; return 0' INT while true; do :; done ) print "Leaving f" } f print "Leaving script" Hitting Ctrl-C during the loop in f causes an immediate exit from the _script_, not just a return from the function, as it should (IMHO). If the trap command is outside the parentheses, it works: function f { trap 'print "INT f"; return 0' INT ( while true; do :; done ) print "Leaving f" } But then the traps won't be automatically restored before leaving the function, which is what I intended. Bernd -- Bernd Eggink Regionales Rechenzentrum der Uni Hamburg eggink@rrz.uni-hamburg.de http://www.rrz.uni-hamburg.de/eggink/BEggink.html