diff options
author | axel <axel@liljencrantz.se> | 2006-02-20 22:55:24 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-02-20 22:55:24 +1000 |
commit | 6901ad361d5e8e96036e266a315b1dc45ba08bb0 (patch) | |
tree | 92056edbec1cd56acdf864e5670267faa193fab2 | |
parent | b21cccf5f0cbc6f1849bed73a0ef3b0af0870480 (diff) |
Make fish continue parsing/executing a file if a command is not found
darcs-hash:20060220125524-ac50b-1f85e530cbbcb45988254c75cd45c11395c5cd27.gz
-rw-r--r-- | parser.c | 36 |
1 files changed, 29 insertions, 7 deletions
@@ -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 ) { |