mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
Make fish continue parsing/executing a file if a command is not found
darcs-hash:20060220125524-ac50b-1f85e530cbbcb45988254c75cd45c11395c5cd27.gz
This commit is contained in:
parent
b21cccf5f0
commit
6901ad361d
1 changed files with 29 additions and 7 deletions
36
parser.c
36
parser.c
|
@ -1940,29 +1940,51 @@ static int parse_job( process_t *p,
|
|||
}
|
||||
else
|
||||
{
|
||||
int tmp;
|
||||
|
||||
/*
|
||||
We couln't find the specified command.
|
||||
|
||||
What we want to happen now is that the
|
||||
specified job won't get executed, and an
|
||||
error message is printed on-screen, but
|
||||
otherwise, the parsing/execution of the
|
||||
file continues. Because of this, we don't
|
||||
want to call error(), since that would stop
|
||||
execution of the file. Instead we let
|
||||
p->actual_command be 0 (null), which will
|
||||
cause the job to silently not execute. We
|
||||
also print an error message.
|
||||
*/
|
||||
if( wcschr( (wchar_t *)al_get( args, 0 ), L'=' ) )
|
||||
{
|
||||
error( EVAL_ERROR,
|
||||
tok_get_pos( tok ),
|
||||
debug( 0,
|
||||
COMMAND_ASSIGN_ERR_MSG,
|
||||
(wchar_t *)al_get( args, 0 ) );
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
error( EVAL_ERROR,
|
||||
tok_get_pos( tok ),
|
||||
debug( 0,
|
||||
_(L"Unknown command '%ls'"),
|
||||
(wchar_t *)al_get( args, 0 ) );
|
||||
|
||||
}
|
||||
|
||||
tmp = current_tokenizer_pos;
|
||||
current_tokenizer_pos = tok_get_pos(tok);
|
||||
|
||||
fwprintf( stderr, L"%ls", parser_current_line() );
|
||||
|
||||
current_tokenizer_pos=tmp;
|
||||
j->skip=1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( is_new_block )
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in a new issue