X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fas3%2Fcompiler.c;h=2e6beb038ff7032431ebc4f3e7f2e7092add5007;hp=9ccaafdc710ef3fadb0aa80286a4ee115d5c5f5b;hb=3e303bea7eb10c99a7b3808f0c355ee63188eb9b;hpb=0185c09ff339aaf744142f96d22e1b145334539d diff --git a/lib/as3/compiler.c b/lib/as3/compiler.c index 9ccaafd..2e6beb0 100644 --- a/lib/as3/compiler.c +++ b/lib/as3/compiler.c @@ -113,6 +113,7 @@ static void as3_parse_file_or_array(const char*name, const char*filename, const a3_parse(); as3_lex_destroy(); finish_file(); + if(fi) fclose(fi); } typedef struct _scheduled_file { @@ -155,7 +156,7 @@ void as3_schedule_file(const char*name, const char*filename) } filename = normalize_path(filename); - + if(dict_contains(scheduled_dict, filename)) { return; //already processed } else { @@ -302,22 +303,19 @@ static void schedule_class(const char*package, const char*cls, char error) strcpy(filename+t, cls); strcpy(filename+t+l2, ".as"); - char*f=0; - if(!(f=find_file(filename, error))) { + char*f=find_file(filename, error); + if(!f) { int i; - /* try lower case filename (not packagename!), too */ - for(i=t;i='A' && filename[i]<='Z') - filename[i] += 'a'-'A'; - } - if(!(f=find_file(filename, error))) { - if(error) { - strcpy(filename+t, cls); - strcpy(filename+t+l2, ".as"); - as3_warning("Could not open file %s", filename); - } - return; - } + filename = filename_to_lowercase(filename); + f=find_file(filename, error); + } + if(!f) { + if(error) { + strcpy(filename+t, cls); + strcpy(filename+t+l2, ".as"); + as3_warning("Could not open file %s", filename); + } + return; } as3_schedule_file(filename, f); }