Jacek Caban : urlmon: Make sure to include query part of relative URI containing path in combine_uri .

Alexandre Julliard julliard at winehq.org
Thu May 12 13:57:51 CDT 2011


Module: wine
Branch: master
Commit: ebf9f12c29362c2c91b64cc38f410f550b471eb0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ebf9f12c29362c2c91b64cc38f410f550b471eb0

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu May 12 14:47:20 2011 +0000

urlmon: Make sure to include query part of relative URI containing path in combine_uri.

---

 dlls/urlmon/tests/uri.c |   81 +++++++++++++++++++++++++++++++++++++++++++++++
 dlls/urlmon/uri.c       |    5 +++
 2 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c
index 5ebdd6e..930622a 100644
--- a/dlls/urlmon/tests/uri.c
+++ b/dlls/urlmon/tests/uri.c
@@ -6078,6 +6078,87 @@ static const uri_combine_test uri_combine_tests[] = {
             {URL_SCHEME_FILE,S_OK},
             {URLZONE_INVALID,E_NOTIMPL}
         }
+    },
+    {   "http://winehq.org/dir/testfile",0,
+        "test?querystring",Uri_CREATE_ALLOW_RELATIVE,
+        0,S_OK,FALSE,
+        {
+            {"http://winehq.org/dir/test?querystring",S_OK},
+            {"winehq.org",S_OK},
+            {"http://winehq.org/dir/test?querystring",S_OK},
+            {"winehq.org",S_OK},
+            {"",S_FALSE},
+            {"",S_FALSE},
+            {"winehq.org",S_OK},
+            {"",S_FALSE},
+            {"/dir/test",S_OK},
+            {"/dir/test?querystring",S_OK},
+            {"?querystring",S_OK},
+            {"http://winehq.org/dir/test?querystring",S_OK},
+            {"http",S_OK},
+            {"",S_FALSE},
+            {"",S_FALSE}
+        },
+        {
+            {Uri_HOST_DNS,S_OK},
+            {80,S_OK},
+            {URL_SCHEME_HTTP,S_OK},
+            {URLZONE_INVALID,E_NOTIMPL}
+        }
+    },
+    {   "http://winehq.org/dir/test",0,
+        "test?querystring",Uri_CREATE_ALLOW_RELATIVE,
+        0,S_OK,FALSE,
+        {
+            {"http://winehq.org/dir/test?querystring",S_OK},
+            {"winehq.org",S_OK},
+            {"http://winehq.org/dir/test?querystring",S_OK},
+            {"winehq.org",S_OK},
+            {"",S_FALSE},
+            {"",S_FALSE},
+            {"winehq.org",S_OK},
+            {"",S_FALSE},
+            {"/dir/test",S_OK},
+            {"/dir/test?querystring",S_OK},
+            {"?querystring",S_OK},
+            {"http://winehq.org/dir/test?querystring",S_OK},
+            {"http",S_OK},
+            {"",S_FALSE},
+            {"",S_FALSE}
+        },
+        {
+            {Uri_HOST_DNS,S_OK},
+            {80,S_OK},
+            {URL_SCHEME_HTTP,S_OK},
+            {URLZONE_INVALID,E_NOTIMPL}
+        }
+    },
+    {   "http://winehq.org/dir/test?querystring",0,
+        "#hash",Uri_CREATE_ALLOW_RELATIVE,
+        0,S_OK,FALSE,
+        {
+            {"http://winehq.org/dir/test?querystring#hash",S_OK},
+            {"winehq.org",S_OK},
+            {"http://winehq.org/dir/test?querystring#hash",S_OK},
+            {"winehq.org",S_OK},
+            {"",S_FALSE},
+            {"#hash",S_OK},
+            {"winehq.org",S_OK},
+            {"",S_FALSE},
+            {"/dir/test",S_OK},
+            {"/dir/test?querystring",S_OK},
+            {"?querystring",S_OK},
+            {"http://winehq.org/dir/test?querystring#hash",S_OK},
+            {"http",S_OK},
+            {"",S_FALSE},
+            {"",S_FALSE}
+        },
+        {
+            {Uri_HOST_DNS,S_OK},
+            {80,S_OK},
+            {URL_SCHEME_HTTP,S_OK},
+            {URLZONE_INVALID,E_NOTIMPL}
+        }
     }
 };
 
diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
index 3517c6c..459d4c4 100644
--- a/dlls/urlmon/uri.c
+++ b/dlls/urlmon/uri.c
@@ -6006,6 +6006,11 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result,
                 }
             }
 
+            if(relative->query_start > -1) {
+                data.query = relative->canon_uri+relative->query_start;
+                data.query_len = relative->query_len;
+            }
+
             /* Make sure the path component is valid. */
             ptr = path;
             pptr = &ptr;




More information about the wine-cvs mailing list