Jacek Caban : urlmon: Properly handle combining relative mk: URIs containing full internal path.
Alexandre Julliard
julliard at winehq.org
Thu Feb 9 15:21:48 CST 2012
Module: wine
Branch: master
Commit: 9cbcbe8da69698b01b4e276715f8f8f317cb07f6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9cbcbe8da69698b01b4e276715f8f8f317cb07f6
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Feb 9 15:16:38 2012 +0100
urlmon: Properly handle combining relative mk: URIs containing full internal path.
---
dlls/urlmon/uri.c | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
index 2710c7c..3d6bf8b 100644
--- a/dlls/urlmon/uri.c
+++ b/dlls/urlmon/uri.c
@@ -6389,13 +6389,25 @@ static HRESULT merge_paths(parse_data *data, const WCHAR *base, DWORD base_len,
WCHAR *ptr;
if(base_len) {
- /* Find the characters that will be copied over from
- * the base path.
- */
- end = memrchrW(base, '/', base_len);
- if(!end && data->scheme_type == URL_SCHEME_FILE)
- /* Try looking for a '\\'. */
- end = memrchrW(base, '\\', base_len);
+ if(data->scheme_type == URL_SCHEME_MK && *relative == '/') {
+ /* Find '::' segment */
+ for(end = base; end < base+base_len-1; end++) {
+ if(end[0] == ':' && end[1] == ':') {
+ end++;
+ break;
+ }
+ }
+
+ /* If not found, try finding the end of @xxx: */
+ if(end == base+base_len-1)
+ end = *base == '@' ? memchr(base, ':', base_len) : NULL;
+ }else {
+ /* Find the characters that will be copied over from the base path. */
+ end = memrchrW(base, '/', base_len);
+ if(!end && data->scheme_type == URL_SCHEME_FILE)
+ /* Try looking for a '\\'. */
+ end = memrchrW(base, '\\', base_len);
+ }
}
if(end) {
@@ -6420,6 +6432,7 @@ static HRESULT merge_paths(parse_data *data, const WCHAR *base, DWORD base_len,
*ptr = '\0';
*result_len = (ptr-*result);
+ TRACE("ret %s\n", debugstr_wn(*result, *result_len));
return S_OK;
}
@@ -6541,7 +6554,7 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result,
* relative path doesn't begin with a '/' then the base path and relative
* path are merged together.
*/
- if(relative->path_len && *(relative->canon_uri+relative->path_start) == '/') {
+ if(relative->path_len && *(relative->canon_uri+relative->path_start) == '/' && data.scheme_type != URL_SCHEME_MK) {
WCHAR *tmp = NULL;
BOOL copy_drive_path = FALSE;
More information about the wine-cvs
mailing list