]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/uri.cpp
wxSizerFlags name fix, accessors only available to wxSizer (supposively :))
[wxWidgets.git] / src / common / uri.cpp
index c251d923265697788739521161875109479b74b2..e1878f78c44efdb00fdc7316689263dfe8b9af92 100644 (file)
@@ -117,7 +117,8 @@ wxChar wxURI::TranslateEscape(const wxChar* s)
 {
     wxASSERT_MSG(IsHex(*s) && IsHex(*(s+1)), wxT("Invalid escape!"));
 
 {
     wxASSERT_MSG(IsHex(*s) && IsHex(*(s+1)), wxT("Invalid escape!"));
 
-    return (wxChar)( CharToHex(*s) * 0x10 ) | CharToHex(*++s);
+    //<<4 == 16
+    return (wxChar)( CharToHex(*s) << 4 ) | CharToHex(*++s);
 }
 
 wxString wxURI::Unescape(const wxString& uri)
 }
 
 wxString wxURI::Unescape(const wxString& uri)
@@ -131,6 +132,8 @@ wxString wxURI::Unescape(const wxString& uri)
             new_uri += wxURI::TranslateEscape( &(uri.c_str()[i+1]) );
             i += 2;
         }
             new_uri += wxURI::TranslateEscape( &(uri.c_str()[i+1]) );
             i += 2;
         }
+        else
+            new_uri += uri[i];
     }
 
     return new_uri;
     }
 
     return new_uri;
@@ -464,7 +467,8 @@ const wxChar* wxURI::ParseServer(const wxChar* uri)
     // IP-literal    = "[" ( IPv6address / IPvFuture  ) "]"
     if (*uri == wxT('['))
     {
     // IP-literal    = "[" ( IPv6address / IPvFuture  ) "]"
     if (*uri == wxT('['))
     {
-        if (ParseIPv6address(++uri) && *uri == wxT(']'))
+        ++uri; //some compilers don't support *&ing a ++*
+        if (ParseIPv6address(uri) && *uri == wxT(']'))
         {
             ++uri;
             m_hostType = wxURI_IPV6ADDRESS;
         {
             ++uri;
             m_hostType = wxURI_IPV6ADDRESS;
@@ -477,7 +481,8 @@ const wxChar* wxURI::ParseServer(const wxChar* uri)
         {
             uri = uricopy;
 
         {
             uri = uricopy;
 
-            if (ParseIPvFuture(++uri) && *uri == wxT(']'))
+            ++uri; //some compilers don't support *&ing a ++*
+            if (ParseIPvFuture(uri) && *uri == wxT(']'))
             {
                 ++uri;
                 m_hostType = wxURI_IPVFUTURE;
             {
                 ++uri;
                 m_hostType = wxURI_IPVFUTURE;