diff lwasm/pseudo.c @ 261:c79b3c88adbc 2.x

Added --depend option to generate a list of dependencies
author lost
date Sat, 26 Dec 2009 08:24:35 +0000
parents e27279180a73
children
line wrap: on
line diff
--- a/lwasm/pseudo.c	Sat Dec 26 02:36:43 2009 +0000
+++ b/lwasm/pseudo.c	Sat Dec 26 08:24:35 2009 +0000
@@ -168,7 +168,8 @@
 	{
 		register_error(as, l, 1, "File include error (%s)", fn);
 	}
-	lwasm_free(fn);
+	as -> incfiles = lwasm_realloc(as -> incfiles, sizeof(char *) * (as -> nincfiles + 1));
+	as -> incfiles[as -> nincfiles++] = fn;
 }
 
 /*
@@ -226,7 +227,8 @@
 	}
 	
 	// don't need fn any more
-	lwasm_free(fn);
+	as -> incfiles = lwasm_realloc(as -> incfiles, sizeof(char *) * (as -> nincfiles + 1));
+	as -> incfiles[as -> nincfiles++] = fn;
 	
 	// read the contents of the file and "emit()" it
 	while (!feof(f) && !ferror(f))