From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15233 invoked by alias); 17 Sep 2015 15:18:54 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 15204 invoked by uid 89); 17 Sep 2015 15:18:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f178.google.com Received: from mail-lb0-f178.google.com (HELO mail-lb0-f178.google.com) (209.85.217.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 17 Sep 2015 15:18:51 +0000 Received: by lbpo4 with SMTP id o4so11128315lbp.2 for ; Thu, 17 Sep 2015 08:18:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=kFZm4FNbzfPvYc6UhQ1imDziPBLNXzEDfROa+/Umo+s=; b=ZTliL7kshwl7Yh7x92hJcTDN1QMPxAaHOXIytnu2Le8EQSzVWVf7snVhQn8KT76OV5 /mwKzUAUB0Th0l/hHbmtnFr3SYxSkgEkYYStzUTIXn7tVNFnXZmCFDfu2Xkbwf8ZgKiD zOTvNACLoCEkBlzH2MD0Zd7SL3JJ1A7tZ8tvbHzgfKh3oBKdReoIbSH0lOGHx5wLW0Qe 5CfWc2UjZjV8yiCU+EEE6xI8IGqqouHk96Hj1HlAOuqmtGhTn6G+PjlEPRJJ4oW22+1L 7DnYza/+8e6g7K3wja0YDV+4OyV2zMQ6yZ8wENUZ9HXFWHE2w14zcfNaZkh+quDzfl1S aBEg== X-Gm-Message-State: ALoCoQkp+a8lWlCu56XDtbn+bSUu8FKb6uhf+aL8YtjXd8F7O8gsjVF7f/bdgfk946jfVXy7+YfN MIME-Version: 1.0 X-Received: by 10.152.23.199 with SMTP id o7mr34666184laf.76.1442503128197; Thu, 17 Sep 2015 08:18:48 -0700 (PDT) Received: by 10.114.216.99 with HTTP; Thu, 17 Sep 2015 08:18:48 -0700 (PDT) Date: Thu, 17 Sep 2015 15:18:00 -0000 Message-ID: Subject: Double-slashes in URLs From: Michael Bisbjerg To: cygwin-apps@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00027.txt.bz2 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. ------ PATCH ----- 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 ? */ ------ PATCH ----- Regards. Michael