diff options
author | axel <axel@liljencrantz.se> | 2006-06-02 12:15:17 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-06-02 12:15:17 +1000 |
commit | a1a2773cbff6a124058d8cb7f2ff36376ecf7f64 (patch) | |
tree | 9ba651a6522c0b0096087cea96e3884356397b9b /reader.c | |
parent | 67f216fa5524de9813206734391bca5948a4c81f (diff) |
Make sure code validation error output for e.g. the complete builtin can be redirected, and that it has the prefix 'complete', not 'fish'
darcs-hash:20060602021517-ac50b-5e566aefbd1c9bcb3a5f11f9fc1125d8c1d9e936.gz
Diffstat (limited to 'reader.c')
-rw-r--r-- | reader.c | 36 |
1 files changed, 22 insertions, 14 deletions
@@ -2099,10 +2099,15 @@ void reader_run_command( wchar_t *cmd ) static int shell_test( wchar_t *b ) { - if( parser_test( b, 0 ) ) + if( parser_test( b, 0, 0 ) ) { + string_buffer_t sb; + sb_init( &sb ); + writech( L'\n' ); - parser_test( b, 1 ); + parser_test( b, &sb, L"fish" ); + fwprintf( stderr, L"%ls", sb.buff ); + sb_destroy( &sb ); return 1; } return 0; @@ -2944,18 +2949,21 @@ static int read_ni( int fd ) if( str ) { - if( !parser_test( str, 1 ) ) - { - eval( str, 0, TOP ); - } - else - { - /* - No error reporting - parser_test did that for us - */ - res = 1; - } - free( str ); + string_buffer_t sb; + sb_init( &sb ); + + if( !parser_test( str, &sb, L"fish" ) ) + { + eval( str, 0, TOP ); + } + else + { + fwprintf( stderr, L"%ls", sb.buff ); + res = 1; + } + sb_destroy( &sb ); + + free( str ); } else { |