From 6756b029999cf0410976c42e312c1814e27ec467 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 10 Apr 2022 06:44:16 +0300 Subject: [PATCH 47/47] fcmp: Allow baseURL to end to '/' See osdn #44309 Signed-off-by: Marko Lindqvist --- tools/fcmp/download.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/fcmp/download.c b/tools/fcmp/download.c index 884f7e3b34..6fd68aedae 100644 --- a/tools/fcmp/download.c +++ b/tools/fcmp/download.c @@ -97,6 +97,7 @@ static const char *download_modpack_recursive(const char *URL, bool partial_failure = FALSE; int dep; const char *dep_name; + int URL_len; if (recursion > 5) { return _("Recursive dependencies too deep"); @@ -190,6 +191,12 @@ static const char *download_modpack_recursive(const char *URL, sz_strlcpy(baseURL, baseURLpart); } + /* Remove potential ending '/' as one will get added later. */ + URL_len = strlen(baseURL); + if (baseURL[URL_len - 1] == '/') { + baseURL[URL_len - 1] = '\0'; + } + dep = 0; do { dep_name = secfile_lookup_str_default(control, NULL, -- 2.35.1