Base status -b off the parser execution stack

Instead of globally marking the state as "in block" when evaluating
blocks/functions, update the "in block" status when pushing/popping
blocks on the parser stack.

Fixes #1729.

On a side note, `status -b` is actually pretty useless, because it
always returns 0 inside of a function (even without this patch).
This commit is contained in:
Kevin Ballard
2014-09-30 20:58:45 -07:00
parent 489fb7ec3f
commit 3616dd5889
4 changed files with 30 additions and 5 deletions

View File

@@ -525,9 +525,6 @@ static void internal_exec_helper(parser_t &parser,
return;
}
int is_block_old=is_block;
is_block=1;
signal_unblock();
if (node_offset == NODE_OFFSET_INVALID)
@@ -544,7 +541,6 @@ static void internal_exec_helper(parser_t &parser,
morphed_chain.clear();
io_cleanup_fds(opened_fds);
job_reap(0);
is_block=is_block_old;
}
/* Returns whether we can use posix spawn for a given process in a given job.