changeset 117:c46959e2d9ef

Handle empty arguments properly when there's more than one argument.
author David A. Holland
date Tue, 11 Jun 2013 14:12:06 -0400
parents f2a9679a2033
children c13f36775fe8
files macro.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/macro.c	Tue Jun 11 14:11:04 2013 -0400
+++ b/macro.c	Tue Jun 11 14:12:06 2013 -0400
@@ -958,6 +958,10 @@
 		break;
 	    case ES_NOARG:
 		assert(es->argparens == 0);
+		if (stringarray_num(&es->args) > 0) {
+			/* we are after a comma; enter an empty argument */
+			expand_newarg(es, buf, 0);
+		}
 		es->state = ES_NORMAL;
 		expand_domacro(es, p);
 		break;