From be3759d7bc8e2d537974363a32389f9e47d8c867 Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 19 Dec 2008 07:58:12 +0000 Subject: [PATCH] export current_filename_short --- lib/as3/files.c | 7 +++++-- lib/as3/files.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/as3/files.c b/lib/as3/files.c index 4d8392b..10e5de6 100644 --- a/lib/as3/files.c +++ b/lib/as3/files.c @@ -55,6 +55,7 @@ typedef struct _include_dir { int current_line=1; int current_column=0; char* current_filename=0; +char* current_filename_short=0; include_dir_t* current_include_dirs=0; #define MAX_INCLUDE_DEPTH 16 @@ -63,6 +64,7 @@ void*include_stack[MAX_INCLUDE_DEPTH]; int line_stack[MAX_INCLUDE_DEPTH]; int column_stack[MAX_INCLUDE_DEPTH]; char* filename_stack[MAX_INCLUDE_DEPTH]; +char* shortfilename_stack[MAX_INCLUDE_DEPTH]; include_dir_t* includedir_stack[MAX_INCLUDE_DEPTH]; int include_stack_ptr = 0; @@ -160,6 +162,7 @@ char*enter_file(char*filename, void*state) include_stack[include_stack_ptr] = state; line_stack[include_stack_ptr] = current_line; column_stack[include_stack_ptr] = current_column; + shortfilename_stack[include_stack_ptr] = current_filename_short = strdup(filename); filename_stack[include_stack_ptr] = current_filename; includedir_stack[include_stack_ptr] = current_include_dirs; add_include_dir(get_path(fullfilename)); @@ -181,8 +184,8 @@ void* leave_file() } else { current_column = column_stack[include_stack_ptr]; current_line = line_stack[include_stack_ptr]; - free(current_filename);current_filename=0; - current_filename = filename_stack[include_stack_ptr]; + free(current_filename);current_filename = filename_stack[include_stack_ptr]; + free(current_filename_short);current_filename_short = shortfilename_stack[include_stack_ptr]; current_include_dirs = includedir_stack[include_stack_ptr]; return include_stack[include_stack_ptr]; } diff --git a/lib/as3/files.h b/lib/as3/files.h index 7243718..c140065 100644 --- a/lib/as3/files.h +++ b/lib/as3/files.h @@ -25,6 +25,7 @@ extern int current_line; extern int current_column; extern char* current_filename; +extern char* current_filename_short; void add_include_dir(char*dir); -- 1.7.10.4