Not all scriptlets have bodies (eg -p /sbin/ldconfig), dont expand NULLs
This commit is contained in:
parent
e34d752b92
commit
b5118bad05
|
@ -526,11 +526,11 @@ static rpmRC handleOneTrigger(const rpmpsm psm,
|
|||
.args = args
|
||||
};
|
||||
|
||||
if (script.flags & RPMSCRIPT_EXPAND) {
|
||||
if (script.body && (script.flags & RPMSCRIPT_EXPAND)) {
|
||||
macro = rpmExpand(script.body, NULL);
|
||||
script.body = macro;
|
||||
}
|
||||
if (script.flags & RPMSCRIPT_QFORMAT) {
|
||||
if (script.body && (script.flags & RPMSCRIPT_QFORMAT)) {
|
||||
qformat = headerFormat(trigH, script.body, NULL);
|
||||
script.body = qformat;
|
||||
}
|
||||
|
|
|
@ -396,13 +396,14 @@ rpmScript rpmScriptFromTag(Header h, rpmTag scriptTag)
|
|||
script->tag = scriptTag;
|
||||
rasprintf(&script->descr, "%s(%s)", tag2sln(scriptTag), nevra);
|
||||
script->body = headerGetAsString(h, scriptTag);
|
||||
|
||||
/* macros need to be expanded before possible queryformat */
|
||||
if (flags & RPMSCRIPT_EXPAND) {
|
||||
if (script->body && (flags & RPMSCRIPT_EXPAND)) {
|
||||
char *body = rpmExpand(script->body, NULL);
|
||||
free(script->body);
|
||||
script->body = body;
|
||||
}
|
||||
if (flags & RPMSCRIPT_QFORMAT) {
|
||||
if (script->body && (flags & RPMSCRIPT_QFORMAT)) {
|
||||
/* XXX TODO: handle queryformat errors */
|
||||
char *body = headerFormat(h, script->body, NULL);
|
||||
free(script->body);
|
||||
|
|
Loading…
Reference in New Issue