Commit c0864294 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shlwapi: Fixed handling mk protocol URLs in UrlCombineW.

parent a4ea1c60
...@@ -234,6 +234,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { ...@@ -234,6 +234,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
{"foo:today", "bar:calendar", 0, S_OK, "bar:calendar"}, {"foo:today", "bar:calendar", 0, S_OK, "bar:calendar"},
{"foo:/today", "foo:calendar", 0, S_OK, "foo:/calendar"}, {"foo:/today", "foo:calendar", 0, S_OK, "foo:/calendar"},
{"foo:/today/", "foo:calendar", 0, S_OK, "foo:/today/calendar"}, {"foo:/today/", "foo:calendar", 0, S_OK, "foo:/today/calendar"},
{"mk:@MSITStore:dir/test.chm::dir/index.html", "image.jpg", 0, S_OK, "mk:@MSITStore:dir/test.chm::dir/image.jpg"},
{"mk:@MSITStore:dir/test.chm::dir/dir2/index.html", "../image.jpg", 0, S_OK, "mk:@MSITStore:dir/test.chm::dir/image.jpg"}
}; };
/* ################ */ /* ################ */
......
...@@ -659,8 +659,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, ...@@ -659,8 +659,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
base.pszSuffix += delta; base.pszSuffix += delta;
base.cchSuffix -= delta; base.cchSuffix -= delta;
} }
} }else {
/* get size of location field (if it exists) */ /* get size of location field (if it exists) */
work = (LPWSTR)base.pszSuffix; work = (LPWSTR)base.pszSuffix;
sizeloc = 0; sizeloc = 0;
...@@ -673,6 +672,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, ...@@ -673,6 +672,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
sizeloc = (DWORD)(work - base.pszSuffix); sizeloc = (DWORD)(work - base.pszSuffix);
} }
} }
}
/* Change .sizep2 to not have the last leaf in it, /* Change .sizep2 to not have the last leaf in it,
* Note: we need to start after the location (if it exists) * Note: we need to start after the location (if it exists)
...@@ -723,7 +723,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, ...@@ -723,7 +723,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
process_case = 4; process_case = 4;
break; break;
} }
process_case = (*base.pszSuffix == '/') ? 5 : 3; process_case = (*base.pszSuffix == '/' || base.nScheme == URL_SCHEME_MK) ? 5 : 3;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment