mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Don't blow away $status in switch statements
Tweak the switch and case builtins to not blow away $status inappropriately. Fixes issue #161.
This commit is contained in:
parent
f7d0c4b065
commit
adfd3c1098
1 changed files with 3 additions and 2 deletions
|
@ -3540,6 +3540,7 @@ static int builtin_switch( parser_t &parser, wchar_t **argv )
|
||||||
parser.current_block->state1<wcstring>() = argv[1];
|
parser.current_block->state1<wcstring>() = argv[1];
|
||||||
parser.current_block->skip=1;
|
parser.current_block->skip=1;
|
||||||
parser.current_block->state2<int>() = 0;
|
parser.current_block->state2<int>() = 0;
|
||||||
|
res = proc_get_last_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -3568,7 +3569,7 @@ static int builtin_case( parser_t &parser, wchar_t **argv )
|
||||||
|
|
||||||
if( parser.current_block->state2<int>() )
|
if( parser.current_block->state2<int>() )
|
||||||
{
|
{
|
||||||
return STATUS_BUILTIN_OK;
|
return proc_get_last_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i=1; i<argc; i++ )
|
for( i=1; i<argc; i++ )
|
||||||
|
@ -3588,7 +3589,7 @@ static int builtin_case( parser_t &parser, wchar_t **argv )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_BUILTIN_OK;
|
return proc_get_last_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue