Set displayed_url to full URL in the site_list_type constructor if from_mirrors_lst is false. Modify check_for_user_urls() to change displayed_url back to the short form if a site in all_site_list turns out to be a stale mirror. --- site.cc | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/site.cc b/site.cc index d4550a1..ef0c218 100644 --- a/site.cc +++ b/site.cc @@ -182,6 +182,12 @@ site_list_type::site_list_type (const string &_url, idx = 0; } while (idx > 0); key += url; + /* Display the full URL (without trailing slash) of a non-mirror. */ + if (!from_mirrors_lst) + { + displayed_url = url; + displayed_url.erase (displayed_url.end () - 1); + } } site_list_type::site_list_type (site_list_type const &rhs) @@ -241,19 +247,31 @@ save_dialog (HWND h) } } -// Does the_site_list contain any sites that are not mirrors (possibly stale)? +// Set allow_user_url = true if all_site_list contains any sites that +// are not mirrors (possibly stale). At the same time, fixup the +// stored information about stale mirrors. static void check_for_user_urls () { - for (SiteList::const_iterator i = all_site_list.begin (); + for (SiteList::iterator i = all_site_list.begin (); i != all_site_list.end (); i++) { - if (!i->from_mirrors_lst - && (find (cached_site_list.begin (), cached_site_list.end (), *i) - == cached_site_list.end ())) + if (!i->from_mirrors_lst) { - allow_user_url = true; - return; + // Is it a stale mirror? + SiteList::iterator j = find (cached_site_list.begin (), + cached_site_list.end (), *i); + if (j == cached_site_list.end ()) + allow_user_url = true; + else + { + i->servername = j->servername; + i->area = j->area; + i->location = j->location; + // i->from_mirrors_lst stays false. + i->displayed_url = j->displayed_url; + i->key = j->key; + } } } } -- 2.15.1