X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..137c8bde085d6d5b7c459902d2ea1a198ab48765:/src/common/uri.cpp?ds=sidebyside diff --git a/src/common/uri.cpp b/src/common/uri.cpp index fbc9031be2..ccc0149a4b 100644 --- a/src/common/uri.cpp +++ b/src/common/uri.cpp @@ -29,7 +29,7 @@ // definitions // --------------------------------------------------------------------------- -IMPLEMENT_CLASS(wxURI, wxObject); +IMPLEMENT_CLASS(wxURI, wxObject) // =========================================================================== // implementation @@ -113,7 +113,7 @@ wxChar wxURI::TranslateEscape(const wxChar* s) { wxASSERT_MSG( IsHex(s[0]) && IsHex(s[1]), wxT("Invalid escape sequence!")); - return (wxChar)( CharToHex(s[0]) << 4 ) | CharToHex(s[1]); + return wx_truncate_cast(wxChar, (CharToHex(s[0]) << 4 ) | CharToHex(s[1])); } wxString wxURI::Unescape(const wxString& uri) @@ -432,11 +432,18 @@ const wxChar* wxURI::ParseAuthority(const wxChar* uri) // authority = [ userinfo "@" ] host [ ":" port ] if (*uri == wxT('/') && *(uri+1) == wxT('/')) { + //skip past the two slashes uri += 2; + // ############# DEVIATION FROM RFC ######################### + // Don't parse the server component for file URIs + if(m_scheme != wxT("file")) + { + //normal way uri = ParseUserInfo(uri); uri = ParseServer(uri); return ParsePort(uri); + } } return uri;