diff --git a/dlls/itss/protocol.c b/dlls/itss/protocol.c index 6b188c6c368..1463518c2cf 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 133a8bfe17b..6fd3431c6f5 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)