aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-03-25 16:06:12 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-03-25 16:06:12 -0700
commitb04e874e432fddb603aa023f39433a4be0387d89 (patch)
tree236aa67b79e6934a227672ebe6e94b1082f63d11 /builtin.cpp
parentd146f578a49ad4164662a6b1bb9db474c3a1b269 (diff)
Teach fish how to push and pop blocks even in the face of no_exec. All tests finally pass.
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin.cpp b/builtin.cpp
index bd41923e..c7088045 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -211,6 +211,10 @@ static int count_char(const wchar_t *str, wchar_t c)
wcstring builtin_help_get(parser_t &parser, const wchar_t *name)
{
+ /* This won't ever work if no_exec is set */
+ if (no_exec)
+ return wcstring();
+
wcstring_list_t lst;
wcstring out;
const wcstring name_esc = escape_string(name, 1);
@@ -3481,7 +3485,7 @@ static int builtin_end(parser_t &parser, wchar_t **argv)
are rewinding a loop, this should be set to false, so that
variables in the current loop scope won't die between laps.
*/
- int kill_block = 1;
+ bool kill_block = true;
switch (parser.current_block->type())
{
@@ -3495,7 +3499,7 @@ static int builtin_end(parser_t &parser, wchar_t **argv)
{
parser.current_block->loop_status = LOOP_NORMAL;
parser.current_block->skip = 0;
- kill_block = 0;
+ kill_block = false;
parser.set_pos(parser.current_block->tok_pos);
while_block_t *blk = static_cast<while_block_t *>(parser.current_block);
blk->status = WHILE_TEST_AGAIN;
@@ -3536,7 +3540,7 @@ static int builtin_end(parser_t &parser, wchar_t **argv)
parser.current_block->loop_status = LOOP_NORMAL;
parser.current_block->skip = 0;
- kill_block = 0;
+ kill_block = false;
parser.set_pos(parser.current_block->tok_pos);
}
break;