diff macro.c @ 27:01c3a2088ab4

fix some more bugs
author David A. Holland
date Mon, 20 Dec 2010 05:01:18 -0500
parents 18681e5ae6e4
children 8a955e3dda2c
line wrap: on
line diff
--- a/macro.c	Mon Dec 20 05:01:07 2010 -0500
+++ b/macro.c	Mon Dec 20 05:01:18 2010 -0500
@@ -467,7 +467,7 @@
 	num = stringarray_num(&m->params);
 	for (i=0; i<num; i++) {
 		param = stringarray_get(&m->params, i);
-		if (strlen(param) == len && !strcmp(name, param)) {
+		if (strlen(param) == len && !memcmp(name, param, len)) {
 			*num_ret = i;
 			return true;
 		}
@@ -493,7 +493,7 @@
 				if (pos > blockstart) {
 					ei = expansionitem_create_stringlen(
 						buf + blockstart,
-						pos - blockstart);
+						wordstart - blockstart);
 					expansionitemarray_add(&m->expansion,
 							       ei, NULL);
 				}