Do not setup macro args for literal macros

They cannot make use of the arguments, so it makes no sense to set
them up.
This commit is contained in:
Michael Schroeder 2021-11-05 13:48:24 +01:00 committed by Panu Matilainen
parent 48825725e6
commit 162b2d3a33
1 changed files with 4 additions and 5 deletions

View File

@ -1363,14 +1363,13 @@ doMacro(MacroBuf mb, rpmMacroEntry me, ARGV_t args, size_t *parsed)
goto exit;
}
me->func(mb, me, args, parsed);
} else if (me->flags & ME_LITERAL) {
if (me->body && *me->body)
mbAppendStr(mb, me->body);
} else if (me->body && *me->body) {
/* Setup args for "%name " macros with opts */
if (args != NULL)
setupArgs(mb, me, args);
if ((me->flags & ME_LITERAL) != 0)
mbAppendStr(mb, me->body);
else
expandMacro(mb, me->body, 0);
/* Free args for "%name " macros with opts */
if (args != NULL)