From: Michael Tremer Date: Wed, 23 Oct 2024 12:06:21 +0000 (+0000) Subject: parser: Fix assigning value X-Git-Tag: 0.9.30~807 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cadc31ec56ac5bd496ff04e25c0f18d803061da2;p=pakfire.git parser: Fix assigning value Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/parser.c b/src/libpakfire/parser.c index ece3af4a0..54852dc84 100644 --- a/src/libpakfire/parser.c +++ b/src/libpakfire/parser.c @@ -355,12 +355,15 @@ int pakfire_parser_apply_declaration(struct pakfire_parser* parser, static int pakfire_parser_find_template(struct pakfire_parser* parser, char* template, const size_t length, const char* namespace) { + const char* value = "MAIN"; + DEBUG(parser->ctx, "Looking up template in namespace '%s'\n", namespace); struct pakfire_parser_declaration* d = pakfire_parser_get_declaration( parser, namespace, "template"); - const char* value = (d && *d->value) ? d->value : "MAIN"; + if (d && d->value && *d->value) + value = d->value; // Format full variable name return __pakfire_string_format(template, length, "packages.template:%s", value);