macro.c: fixed macroTable corruption in freeArgs

This commit is contained in:
Alexey Tourbin 2011-01-06 05:52:17 +03:00
parent d6e06cbbd5
commit 05eb59911d

View File

@ -770,7 +770,7 @@ freeArgs(MacroBuf mb)
me = *mep; me = *mep;
if (me->level < mb->depth) if (me->level < mb->depth)
continue; goto skip;
if (strlen(me->name) == 1 && strchr("#*0", *me->name)) { if (strlen(me->name) == 1 && strchr("#*0", *me->name)) {
if (*me->name == '*' && me->used > 0) if (*me->name == '*' && me->used > 0)
skiptest = 1; /* XXX skip test for %# %* %0 */ skiptest = 1; /* XXX skip test for %# %* %0 */
@ -782,6 +782,7 @@ freeArgs(MacroBuf mb)
#endif #endif
} }
popMacro(mep); popMacro(mep);
skip:
if (*mep == NULL) if (*mep == NULL)
ndeleted++; ndeleted++;
else if (ndeleted) { else if (ndeleted) {