Fix for what I believe to be a bug in fish trunk where you can't always successfully control-C out of some while loops

This commit is contained in:
ridiculousfish 2012-06-04 15:10:35 -07:00
parent 69446be1ee
commit b877181e17
2 changed files with 10 additions and 6 deletions

View file

@ -391,10 +391,12 @@ void parser_t::skip_all_blocks(void)
/* Tell all blocks to skip */
if (s_principal_parser)
{
//write(2, "Cancelling blocks\n", strlen("Cancelling blocks\n"));
block_t *c = s_principal_parser->current_block;
while( c )
{
c->skip = true;
//fprintf(stderr, " Cancelled %p\n", c);
c = c->outer;
}
}
@ -2292,7 +2294,7 @@ void parser_t::eval_job( tokenizer *tok )
profile_item_t *profile_item = NULL;
int skip = 0;
bool skip = false;
int job_begin_pos, prev_tokenizer_pos;
const bool do_profile = profile;
@ -2333,7 +2335,6 @@ void parser_t::eval_job( tokenizer *tok )
}
j->first_process = new process_t();
job_begin_pos = tok_get_pos( tok );
if( parse_job( j->first_process, j, tok ) &&
@ -2358,9 +2359,9 @@ void parser_t::eval_job( tokenizer *tok )
profile_item->skipped=current_block->skip;
}
skip |= current_block->skip;
skip |= job_get_flag( j, JOB_WILDCARD_ERROR );
skip |= job_get_flag( j, JOB_SKIP );
skip = skip || current_block->skip;
skip = skip || job_get_flag( j, JOB_WILDCARD_ERROR );
skip = skip || job_get_flag( j, JOB_SKIP );
if(!skip )
{
@ -2396,7 +2397,9 @@ void parser_t::eval_job( tokenizer *tok )
{
case WHILE_TEST_FIRST:
{
current_block->skip = proc_get_last_status()!= 0;
// PCA I added the 'current_block->skip ||' part because we couldn't reliably
// control-C out of loops like this: while test 1 -eq 1; end
current_block->skip = current_block->skip || proc_get_last_status()!= 0;
current_block->state1<int>()=WHILE_TESTED;
}
break;

View file

@ -19,6 +19,7 @@ li {
<li><b>Overrides of default functions should be fixed</b>. The "internalized scripts" feature is disabled for now.</li>
<li><b>Disabled delayed suspend</b>. This is a strange job-control feature of BSD systems, including OS X. Disabling it frees up Control Y for other purposes; in particular, for yank, which now works on OS X.</li>
<li><b>fish_indent is fixed</b>. In particular, the <span class="mono">funced</span> and <span class="mono">funcsave</span> functions work again.
<li>A SIGTERM now ends the whole execution stack again (<a href="https://github.com/ridiculousfish/fishfish/issues/13">from this issue</a>).
</ul>