summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-02-22 13:56:06 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-02-22 14:02:44 +0200
commit3a194ea5d792a1c34ce561c04bf0fa7e575aa949 (patch)
tree399111bb6fd948ce0ac82c9e320fe44ae8e6e55c /src/database.c
parentfedaa44546af1b8c05131119752cc2f3f682ae7c (diff)
downloadapk-tools-3a194ea5d792a1c34ce561c04bf0fa7e575aa949.tar.gz
apk-tools-3a194ea5d792a1c34ce561c04bf0fa7e575aa949.tar.bz2
apk-tools-3a194ea5d792a1c34ce561c04bf0fa7e575aa949.tar.xz
apk-tools-3a194ea5d792a1c34ce561c04bf0fa7e575aa949.zip
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"
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c2
1 files changed, 1 insertions, 1 deletions
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));