Actually return errors from macro definition

This commit is contained in:
Panu Matilainen 2017-01-19 14:24:26 +02:00
parent bd942d5fee
commit 31bc44c5a9
1 changed files with 6 additions and 3 deletions

View File

@ -1418,12 +1418,14 @@ static void popMacro(rpmMacroContext mc, const char * n)
static int defineMacro(rpmMacroContext mc, const char * macro, int level)
{
MacroBuf mb = xcalloc(1, sizeof(*mb));
int rc;
/* XXX just enough to get by */
mb->mc = mc;
(void) doDefine(mb, macro, strlen(macro), level, 0);
rc = mb->error;
_free(mb);
return 0;
return rc;
}
static int loadMacroFile(rpmMacroContext mc, const char * fn)
@ -1529,10 +1531,11 @@ void rpmPopMacro(rpmMacroContext mc, const char * n)
int
rpmDefineMacro(rpmMacroContext mc, const char * macro, int level)
{
int rc;
mc = rpmmctxAcquire(mc);
(void) defineMacro(mc, macro, level);
rc = defineMacro(mc, macro, level);
rpmmctxRelease(mc);
return 0;
return rc;
}
void