diff lwasm/unicorns.c @ 224:3864d96ee8c7

Make unicorns notice referenced files better Fix bug related to includebin and also make unicorns notice all files opened through the input subsystem when generating the resource list.
author William Astle <lost@l-w.ca>
date Sun, 15 Jul 2012 20:50:18 -0600
parents 211fc8038b8d
children 7c2c2239ec9c
line wrap: on
line diff
--- a/lwasm/unicorns.c	Sun Jul 15 20:14:51 2012 -0600
+++ b/lwasm/unicorns.c	Sun Jul 15 20:50:18 2012 -0600
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "input.h"
 #include "lwasm.h"
 #include "lw_alloc.h"
 
@@ -47,18 +48,17 @@
 
 void lwasm_do_unicorns(asmstate_t *as)
 {
-	char *n;
+	struct ifl *ifl;
 	macrotab_t *me;
 	structtab_t *se;
 	int i;
 			
 	/* output file list */	
-	while ((n = lw_stack_pop(as -> includelist)))
+	for (ifl = ifl_head; ifl; ifl = ifl -> next)
 	{
 		fputs("RESOURCE: type=file,filename=", stdout);
-		print_urlencoding(stdout, n);
+		print_urlencoding(stdout, ifl -> fn);
 		fputc('\n', stdout);
-		lw_free(n);
 	}
 	
 	/* output macro list */