Arrange single point of exit in expandMacro()

This commit is contained in:
Panu Matilainen 2017-01-19 13:41:42 +02:00
parent 1b4744e1c6
commit b298e93686
1 changed files with 3 additions and 2 deletions

View File

@ -990,8 +990,8 @@ expandMacro(MacroBuf mb, const char *src, size_t slen)
_("Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration.\n"));
mb->depth--;
mb->expand_trace = 1;
_free(source);
return 1;
rc = 1;
goto exit;
}
while (rc == 0 && (c = *s) != '\0') {
@ -1288,6 +1288,7 @@ expandMacro(MacroBuf mb, const char *src, size_t slen)
mb->depth--;
if (rc != 0 || mb->expand_trace)
printExpansion(mb, mb->buf+tpos, mb->buf+mb->tpos);
exit:
_free(source);
return rc;
}