diff options
author | axel <axel@liljencrantz.se> | 2006-02-03 01:23:56 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-02-03 01:23:56 +1000 |
commit | 06fd1aa9f8aa2d9705ba942055c76518fb1da1f6 (patch) | |
tree | 4a6d3e47b2b282d3b376ae31dbc02fae0a8f145f /main.c | |
parent | 5942a6d6c193f6d985d9f4eaada7c8113a40d1c0 (diff) |
Make stack traces print absolute filenames
darcs-hash:20060202152356-ac50b-9e6ab31c03d5f49824ccca7eee3b8e62d66b0009.gz
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -244,7 +244,8 @@ int main( int argc, char **argv ) int i; string_buffer_t sb; int fd; - + wchar_t *rel_filename, *abs_filename; + if( ( fd = open(file, O_RDONLY) ) == -1 ) { wperror( L"open" ); @@ -267,8 +268,13 @@ int main( int argc, char **argv ) env_set( L"argv", (wchar_t *)sb.buff, 0 ); sb_destroy( &sb ); } + + rel_filename = str2wcs( file ); + abs_filename = wrealpath( rel_filename, 0 ); + reader_push_current_filename( intern( abs_filename ) ); + free( rel_filename ); + free( abs_filename ); - reader_push_current_filename( str2wcs( file ) ); res = reader_read( fd ); if( res ) @@ -277,7 +283,7 @@ int main( int argc, char **argv ) _(L"Error while reading file %ls\n"), reader_current_filename()?reader_current_filename(): _(L"Standard input") ); } - free(reader_pop_current_filename()); + reader_pop_current_filename(); } } } |