Jacek Caban : itss: Fixed fragment part handling in IInternetProtocolInfo:: CombineUrl.

Alexandre Julliard julliard at winehq.org
Wed Dec 5 13:43:10 CST 2012


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Dec  5 18:38:40 2012 +0100

itss: Fixed fragment part handling in IInternetProtocolInfo::CombineUrl.

---

 dlls/itss/protocol.c       |    4 +++-
 dlls/itss/tests/protocol.c |    6 ++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/itss/protocol.c b/dlls/itss/protocol.c
index 6b188c6..1463518 100644
--- a/dlls/itss/protocol.c
+++ b/dlls/itss/protocol.c
@@ -469,7 +469,9 @@ static HRESULT WINAPI ITSProtocolInfo_CombineUrl(IInternetProtocolInfo *iface,
     if(strchrW(pwzRelativeUrl, ':'))
         return STG_E_INVALIDNAME;
 
-    if(pwzRelativeUrl[0] != '/') {
+    if(pwzRelativeUrl[0] == '#') {
+        base_end += strlenW(base_end);
+    }else if(pwzRelativeUrl[0] != '/') {
         ptr = strrchrW(base_end, '/');
         if(ptr)
             base_end = ptr+1;
diff --git a/dlls/itss/tests/protocol.c b/dlls/itss/tests/protocol.c
index 133a8bf..6fd3431 100644
--- a/dlls/itss/tests/protocol.c
+++ b/dlls/itss/tests/protocol.c
@@ -483,6 +483,12 @@ static const struct {
     {"mk:@MSITStore:test.chm::/dir/blank.html", "test.html", 0, S_OK, "mk:@MSITStore:test.chm::/dir/test.html"},
     {"xxx:test.chm::/dir/blank.html", "test.html", 0, INET_E_USE_DEFAULT_PROTOCOLHANDLER, NULL},
     {"its:test.chm::/dir/blank.html", "/test.html", 0, S_OK, "its:test.chm::/test.html"},
+    {"its:test.chm::/blank.html", "#frag", 0, S_OK, "its:test.chm::/blank.html#frag"},
+    {"its:test.chm::/blank.html#hash", "#frag", 0, S_OK, "its:test.chm::/blank.html#hash#frag"},
+    {"its:test.chm::/blank.html", "test.html#frag", 0, S_OK, "its:test.chm::/test.html#frag"},
+    {"its:test.chm::/blank.html", "/test.html#frag", 0, S_OK, "its:test.chm::/test.html#frag"},
+    {"its:test.chm::/blank.html", "?query", 0, S_OK, "its:test.chm::/?query"},
+    {"its:test.chm::/blank.html#frag/blank", "test.html", 0, S_OK, "its:test.chm::/blank.html#frag/test.html"},
 };
 
 static void test_its_protocol_info(IInternetProtocol *protocol)




More information about the wine-cvs mailing list