X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Ffiles.c;h=6e75fd724664cb72bc8f3134cdfbbc4e110fbe1b;hb=1d760c9b16e39b250bd614de56741405a7ed824e;hp=8deefbf3b47fc60e29896ee4480d31404ef12b32;hpb=64d8398cb8f8a1045e9670d6882072afb9a0bcef;p=swftools.git diff --git a/lib/as3/files.c b/lib/as3/files.c index 8deefbf..6e75fd7 100644 --- a/lib/as3/files.c +++ b/lib/as3/files.c @@ -201,7 +201,7 @@ char is_absolute(const char*filename) return 0; } -char*find_file(const char*filename) +char*find_file(const char*filename, char error) { include_dir_t*i = current_include_dirs; FILE*fi = 0; @@ -212,7 +212,7 @@ char*find_file(const char*filename) return strdup(filename); } } else { - if(!i) { + if(!i && error) { as3_warning("Include directory stack is empty, while looking for file %s", filename); } while(i) { @@ -227,6 +227,9 @@ char*find_file(const char*filename) i = i->next; } } + if(!error) { + return 0; + } as3_error("Couldn't find file %s", filename); i = current_include_dirs; @@ -249,9 +252,11 @@ void enter_file(const char*name, const char*filename, void*state) shortfilename_stack[include_stack_ptr] = current_filename_short; filename_stack[include_stack_ptr] = current_filename; includedir_stack[include_stack_ptr] = current_include_dirs; - char*dir = get_path(filename); + + /*char*dir = get_path(filename); add_include_dir(dir); - free(dir); + free(dir);*/ + include_stack_ptr++; dbg("entering file %s", filename);