From 3a194ea5d792a1c34ce561c04bf0fa7e575aa949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 22 Feb 2022 13:56:06 +0200 Subject: [PATCH] db: fix apkindex path generation remove the left over apk_blob_push_fmt() call that corrupted uri and trim the path end from trailing slashes to get original functionality. fixes commit be4ce407 "support new index format without attaching arch" --- src/database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database.c b/src/database.c index 1e674d7..a81feb1 100644 --- a/src/database.c +++ b/src/database.c @@ -608,7 +608,7 @@ int apk_repo_format_real_url(apk_blob_t *default_arch, struct apk_repository *re r = snprintf(buf, len, BLOB_FMT, BLOB_PRINTF(uri)); } } else { - apk_blob_push_fmt(&uri, "/" BLOB_FMT, BLOB_PRINTF(arch)); + while (uri.len && uri.ptr[uri.len-1] == '/') uri.len--; if (pkg != NULL) r = snprintf(buf, len, BLOB_FMT "/" BLOB_FMT "/" PKG_FILE_FMT, BLOB_PRINTF(uri), BLOB_PRINTF(arch), PKG_FILE_PRINTF(pkg));