From: Michael Tremer Date: Wed, 5 Feb 2025 10:53:31 +0000 (+0000) Subject: repo: Don't return an empty mirrorlist URL, return NULL instead X-Git-Tag: 0.9.30~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efddaf0a58f561095ab6fc0d55a07053f0648d91;p=pakfire.git repo: Don't return an empty mirrorlist URL, return NULL instead Signed-off-by: Michael Tremer --- 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) {