]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Set repo pointer for internal repositories, too
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Aug 2021 16:30:01 +0000 (16:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Aug 2021 16:30:01 +0000 (16:30 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/repo.c

index 68e984fd60370c39dae86340b5b71267684c25b5..586cdfe8d383101b1fc21d33de86ef82d44fd670 100644 (file)
@@ -432,10 +432,8 @@ PAKFIRE_EXPORT int pakfire_repo_create(struct pakfire_repo** repo,
 
        // Return existing repositories with the same name
        struct pakfire_repo* rep = pakfire_get_repo(pakfire, name);
-       if (rep) {
-               *repo = rep;
-               return 0;
-       }
+       if (rep)
+               goto SUCCESS;
 
        // Create a new one
        rep = calloc(1, sizeof(*rep));
@@ -468,7 +466,7 @@ PAKFIRE_EXPORT int pakfire_repo_create(struct pakfire_repo** repo,
 
        // Skip remaining initialization for "internal" repositories
        if (pakfire_repo_is_internal(rep))
-               return 0;
+               goto SUCCESS;
 
        // Make path to mirrorlist
        r = pakfire_make_cache_path(pakfire, rep->appdata->mirrorlist,
@@ -489,6 +487,7 @@ PAKFIRE_EXPORT int pakfire_repo_create(struct pakfire_repo** repo,
                goto ERROR;
        }
 
+SUCCESS:
        *repo = rep;
        return 0;