X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/97d8fe87918a2ceabd531b8deecb3a316c875dbb..4c268e6a10d820b9ea9851924e37014caa9fb5e8:/src/common/uri.cpp diff --git a/src/common/uri.cpp b/src/common/uri.cpp index 80cbfa47c8..ccc0149a4b 100644 --- a/src/common/uri.cpp +++ b/src/common/uri.cpp @@ -16,10 +16,6 @@ // headers // --------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "uri.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -33,7 +29,7 @@ // definitions // --------------------------------------------------------------------------- -IMPLEMENT_CLASS(wxURI, wxObject); +IMPLEMENT_CLASS(wxURI, wxObject) // =========================================================================== // implementation @@ -117,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) @@ -436,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;