This is the mail archive of the cygwin-apps mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/4] Canonicalize mirror URLs to ensure they end with a '/'

This prevents a mirror URL being added twice (with and without a terminal '/')

This ensures that the download directory is consistently named, avoiding
downloading everything again, even if an additional mirror URL is added
in a form which differs in the presence of a terminal '/' from last time.

2010-11-26  Jon TURNEY <>

	* (init): Canonicalize mirror URLs to ensure the end
	with a '/'.

Signed-off-by: Jon TURNEY <>
--- |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ b/
index 42839f3..ff617b5 100644
--- a/
+++ b/
@@ -141,6 +141,10 @@ site_list_type::init (const string &_url, const string &_servername,
   area = _area;
   location = _location;
+  /* Canonicalize URL to ensure it ends with a '/' */
+  if ( != '/')
+    url.append("/");
   /* displayed_url is protocol and site name part of url */
   string::size_type path_offset = url.find ("/", url.find ("//") + 2);
   displayed_url = url.substr(0, path_offset);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]