From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13152 invoked by alias); 20 Oct 2015 12:22:15 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 13131 invoked by uid 9795); 20 Oct 2015 12:22:14 -0000 Date: Tue, 20 Oct 2015 12:22:00 -0000 Message-ID: <20151020122214.13105.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup] branch master, updated. release_2.873-1-g46826f2 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 679f6a2e3a4d62391e31abc1e880273becbd3dcb X-Git-Newrev: 46826f23828bf0c057bbf0c682b9375281622339 X-SW-Source: 2015-q4/txt/msg00004.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;h=46826f23828bf0c057bbf0c682b9375281622339 commit 46826f23828bf0c057bbf0c682b9375281622339 Author: Michael Bisbjerg Date: Fri Sep 18 14:31:37 2015 +0100 Avoid double-slashes in URLs I noticed once I set up a mirror of my own, that Cygwin Setup will prepend all it's URL's with a double-slash. This does not seem to be intentional, and I found the place in the sources where I believe the error to be. On line 160 of "download.cc", we see that the "n->key" is the source of the repository, including a "/", as it is used as the name of the local cache, which always has a "%2f" in its name. That key is then used on line 165 in "get_url_to_file", where it is concatenated with another slash and "pkgsource.Canonical" to make the final URL. My (untested) patch removes this slash, so that the resulting URL's will be with a single slash. Diff: --- download.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/download.cc b/download.cc index a5aebe0..e319ed4 100644 --- a/download.cc +++ b/download.cc @@ -162,7 +162,7 @@ download_one (packagesource & pkgsource, HWND owner) pkgsource.Canonical (); io_stream::mkpath_p (PATH_TO_FILE, "file://" + local, 0); - if (get_url_to_file(n->key + "/" + pkgsource.Canonical (), + if (get_url_to_file(n->key + pkgsource.Canonical (), local + ".tmp", pkgsource.size, owner)) { /* FIXME: note new source ? */