summaryrefslogtreecommitdiff
path: root/lib/as3/compiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/as3/compiler.c')
-rw-r--r--lib/as3/compiler.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/as3/compiler.c b/lib/as3/compiler.c
index 9ccaafdc..2e6beb03 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<t+l2;i++) {
- if(filename[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);
}