This ensures that the download directory is canonically named with the
trailing %2f of the url-encoded '/', avoiding downloading everything again
if the URL varies in the presence of a '/' at the end from last time.

This also prevents a mirror URL being added twice in these two different
forms.

2010-11-07  Jon TURNEY  <[email protected]>

        * site.cc (OnMessageCmd): Canonicalize manually added mirror URLS to
        ensure they end with '/'
---
 site.cc |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/site.cc b/site.cc
index a7b378e..1a65ec9 100644
--- a/site.cc
+++ b/site.cc
@@ -688,6 +688,11 @@ bool SitePage::OnMessageCmd (int id, HWND hwndctl, UINT 
code)
          {
            // User pushed the Add button.
            std::string other_url = egetString (GetHWND (), IDC_EDIT_USER_URL);
+
+            // Ensure it ends with a '/'
+            if (other_url.at(other_url.length()-1) != '/')
+              other_url.append("/");
+
            if (other_url.size())
            {
            site_list_type newsite (other_url, "", "", "");
-- 
1.7.2.3

Reply via email to