]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
parser: Minor cleanup when searching for a template
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 12:39:56 +0000 (12:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 12:39:56 +0000 (12:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/parser.c

index 8d0cd8200b0899b8168e6dc1f56312f316c8b4ff..70f934de508b4fa175aedda9032b15154d2215d7 100644 (file)
@@ -424,13 +424,13 @@ 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) {
+       struct pakfire_parser_declaration* d = NULL;
        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");
-
+       // Fetch the declaration
+       d = pakfire_parser_get_declaration(parser, namespace, "template");
        if (d && d->value && *d->value)
                value = d->value;