changeset 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 ef8bedab8a4b
children f263adbf7445
files macro.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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;