zsh-workers
 help / color / mirror / code / Atom feed
From: Chet Ramey <chet.ramey@case.edu>
To: Peter Stephenson <p.stephenson@samsung.com>, zsh-workers@zsh.org
Cc: chet.ramey@case.edu, "Eduardo A. Bustamante Lopez" <dualbus@gmail.com>
Subject: Re: Zsh does not follow POSIX when return is called during the action of a trap
Date: Wed, 12 Mar 2014 13:49:18 -0400	[thread overview]
Message-ID: <53209E1E.2090007@case.edu> (raw)
In-Reply-To: <20140312170309.48ea7444@pwslap01u.europe.root.pri>

On 3/12/14 1:03 PM, Peter Stephenson wrote:

> However, I'm trying to work out what happens with the case
> 
> |  trap '(exit BEFORE-RETURN); return EXPLICIT-RETURN-VALUE' SIGNAL
> |
> |  fn() {
> |    (exit BEFORE-ACTION); -block here waiting for signal-
> |  }
> 
> Should this exit with EXPLICIT-RETURN_VALUE or BEFORE-ACTION?  The
> latter is easier to implement but my guess (without ploughing through
> the standard) is EXPLICIT-RETURN-VALUE is right here.

The correct exit value is EXPLICIT-RETURN-VALUE.

The standards text that Eduardo quoted only applies to the case where
`return' is not given an argument.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/


  parent reply	other threads:[~2014-03-12 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 15:36 Eduardo A. Bustamante López
2014-03-12 16:52 ` Bart Schaefer
2014-03-12 17:03   ` Peter Stephenson
2014-03-12 17:47     ` Eduardo A. Bustamante López
2014-03-12 17:49     ` Chet Ramey [this message]
2014-03-12 18:23       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53209E1E.2090007@case.edu \
    --to=chet.ramey@case.edu \
    --cc=dualbus@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).