]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Don't return an empty mirrorlist URL, return NULL instead
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Feb 2025 10:53:31 +0000 (10:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Feb 2025 10:53:31 +0000 (10:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/repo.c

index 6b0b6770b704956722e336697b52550fc7f7b3a3..2d4c7568f9644dcf32b856d7139360c1c8c3147e 100644 (file)
@@ -1715,8 +1715,11 @@ struct pakfire_key* pakfire_repo_get_key(struct pakfire_repo* self) {
        return NULL;
 }
 
-const char* pakfire_repo_get_mirrorlist_url(struct pakfire_repo* repo) {
-       return repo->appdata->mirrorlist_url;
+const char* pakfire_repo_get_mirrorlist_url(struct pakfire_repo* self) {
+       if (*self->appdata->mirrorlist_url)
+               return self->appdata->mirrorlist_url;
+
+       return NULL;
 }
 
 int pakfire_repo_set_mirrorlist_url(struct pakfire_repo* repo, const char* url) {