mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
Fix glitches in stack trace
darcs-hash:20060126154722-ac50b-0d44e98b6d98e3b42f60f66f5bfa2c5f97ea2bd8.gz
This commit is contained in:
8
parser.c
8
parser.c
@@ -401,6 +401,7 @@ void parser_pop_block()
|
||||
case FUNCTION_CALL:
|
||||
{
|
||||
free( current_block->param1.function_name );
|
||||
free( current_block->param4.function_filename );
|
||||
al_foreach( ¤t_block->param2.function_vars,
|
||||
(void (*)(const void *))&free );
|
||||
al_destroy( ¤t_block->param2.function_vars );
|
||||
@@ -1023,7 +1024,8 @@ static void parser_stack_trace( block_t *b, string_buffer_t *buff)
|
||||
|
||||
sb_printf( buff, _(L"in function '%ls',\n"), b->param1.function_name );
|
||||
|
||||
const wchar_t *file = function_get_definition_file( b->param1.function_name );
|
||||
const wchar_t *file = b->param4.function_filename;
|
||||
|
||||
if( file )
|
||||
sb_printf( buff,
|
||||
_(L"\tcalled on line %d of file '%ls',\n"),
|
||||
@@ -1094,7 +1096,7 @@ int parser_get_lineno()
|
||||
return lineno;
|
||||
}
|
||||
|
||||
static const wchar_t *parser_current_filename()
|
||||
const wchar_t *parser_current_filename()
|
||||
{
|
||||
block_t *b = current_block;
|
||||
|
||||
@@ -1188,7 +1190,7 @@ wchar_t *parser_current_line()
|
||||
/**
|
||||
If we are not going to print a stack trace, at least print the line number and filename
|
||||
*/
|
||||
if( !is_interactive )
|
||||
if( !is_interactive || is_function() )
|
||||
{
|
||||
int prev_width = my_wcswidth( (wchar_t *)lineinfo->buff );
|
||||
if( file )
|
||||
|
||||
Reference in New Issue
Block a user