diff macro.c @ 42:ad7763329eba

Don't crash if a macro tries to expand itself recursively.
author David A. Holland
date Sat, 30 Mar 2013 22:29:42 -0400
parents 291fefe664f2
children 2e25e55dba6b
line wrap: on
line diff
--- a/macro.c	Sat Mar 30 21:50:37 2013 -0400
+++ b/macro.c	Sat Mar 30 22:29:42 2013 -0400
@@ -844,7 +844,7 @@
 			break;
 		}
 		m = macrotable_findlen(buf, len, false);
-		if (m == NULL) {
+		if (m == NULL || m->inuse) {
 			expand_send(es, p, buf, len);
 		} else if (!m->hasparams) {
 			m->inuse = true;