From 6f1b323f904eb2626d6cb89c7a1e9cbaa43443c4 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sun, 13 Jun 2004 23:02:45 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3560 --- lib/util.C | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/util.C b/lib/util.C index 9b5f41f2a9..eb7ad38bd2 100755 --- a/lib/util.C +++ b/lib/util.C @@ -403,16 +403,29 @@ inline void replace_string( } } + +struct Tolower +{ + Tolower (std::locale const& l) : loc(l) {;} + char operator() (char c) { return std::tolower(c,loc); } +private: + std::locale const& loc; +}; + + // Canonicalize a master url. // - Convert the first part of a URL (before the "://") to lowercase // - Remove double slashes // - Add a trailing slash if necessary // void canonicalize_master_url(string& url) { + + Tolower down ( std::locale("C") ); + string::size_type p = url.find("://"); // lowercase http:// if (p != string::npos) { - transform(url.begin(), url.begin()+p, url.begin(), tolower); + transform(url.begin(), url.begin()+p, url.begin(), down); p += 3; } else { p = 0;