diff lwasm/pseudo.c @ 386:af5f2c51db76

Bugfixing on includes
author lost@starbug
date Sun, 16 May 2010 13:03:17 -0600
parents eacdae8a1575
children a741d2e4869f
line wrap: on
line diff
--- a/lwasm/pseudo.c	Sun May 16 11:50:00 2010 -0600
+++ b/lwasm/pseudo.c	Sun May 16 13:03:17 2010 -0600
@@ -912,6 +912,7 @@
 		/* do nothing */ ;
 	
 	sym = lw_strndup(*p, i);
+	(*p) += i;
 	
 	s = lookup_symbol(as, l, sym);
 	
@@ -1005,6 +1006,7 @@
 PARSEFUNC(pseudo_parse_include)
 {
 	char *fn, *p2;
+	char *p3;
 	int delim = 0;
 	
 	if (!**p)
@@ -1027,11 +1029,13 @@
 			/* do nothing */ ;
 	}
 	fn = lw_strndup(*p, p2 - *p);
-	
+	(*p) = p2;
 	if (delim && **p)
 		(*p)++;
 	
-	input_open(as, fn);
+	0 == asprintf(&p3, "include:%s", fn);
+	input_open(as, p3);
+	lw_free(p3);
 
 	l -> len = 0;
 }