From efddaf0a58f561095ab6fc0d55a07053f0648d91 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 5 Feb 2025 10:53:31 +0000 Subject: [PATCH] repo: Don't return an empty mirrorlist URL, return NULL instead Signed-off-by: Michael Tremer --- src/pakfire/repo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pakfire/repo.c b/src/pakfire/repo.c index 6b0b6770..2d4c7568 100644 --- a/src/pakfire/repo.c +++ b/src/pakfire/repo.c @@ -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) { -- 2.39.5