jilles f250dc2f44 sh: Allow EV_EXIT through function calls, make {...} <redir more consistent.
If EV_EXIT causes an exit, use the exception mechanism to unwind
redirections and local variables. This way, if the final command is a
redirected command, an EXIT trap now executes without the redirections.

Because of these changes, EV_EXIT can now be inherited by the body of a
function, so do so. This means that a function no longer prevents a fork
before an exec being skipped, such as in
  f() { head -1 /etc/passwd; }; echo $(f)

Wrapping a single builtin in a function may still cause an otherwise
unnecessary fork with command substitution, however.

An exit command or -e failure still invokes the EXIT trap with the
original redirections and local variables in place.

Note: this depends on SHELLPROC being gone. A SHELLPROC depended on
keeping the redirections and local variables and only cleaning up the
state to restore them.
2011-04-23 22:28:56 +00:00
..
2009-10-15 18:17:29 +00:00
2010-06-02 09:34:41 +00:00
2009-01-30 16:23:57 +00:00
2011-02-21 09:01:34 +00:00
2006-12-18 15:45:01 +00:00
2011-02-12 20:28:15 +00:00
2009-06-23 23:30:56 +00:00
2011-02-21 16:03:39 +00:00
2011-03-15 22:22:11 +00:00
2006-12-27 11:28:00 +00:00
2009-09-04 21:49:37 +00:00
2011-02-04 16:40:50 +00:00
2011-03-15 22:22:11 +00:00
2010-02-15 14:07:40 +00:00
2006-12-27 12:14:56 +00:00
2011-03-15 22:22:11 +00:00
2009-10-15 18:17:29 +00:00
2010-09-13 01:29:51 +00:00