Jacek Caban : mshtml: Use fake scheme only for about protocol in nsIURI:: GetScheme.
Alexandre Julliard
julliard at winehq.org
Wed Aug 18 12:09:59 CDT 2010
Module: wine
Branch: master
Commit: 793b021fd0133dda8d77d16def9e185054492500
URL: http://source.winehq.org/git/wine.git/?a=commit;h=793b021fd0133dda8d77d16def9e185054492500
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Aug 18 13:37:56 2010 +0200
mshtml: Use fake scheme only for about protocol in nsIURI::GetScheme.
---
dlls/mshtml/nsio.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index 986cc76..d7b0989 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -1623,11 +1623,20 @@ static nsresult NSAPI nsURI_GetScheme(nsIURL *iface, nsACString *aScheme)
TRACE("(%p)->(%p)\n", This, aScheme);
if(This->use_wine_url) {
- /*
- * For Gecko we set scheme to unknown so it won't be handled
- * as any special case.
- */
- nsACString_SetData(aScheme, "wine");
+ char scheme[INTERNET_MAX_SCHEME_LENGTH+1];
+ WCHAR *ptr;
+ int len;
+
+ ptr = strchrW(This->wine_url, ':');
+ if(!ptr) {
+ nsACString_SetData(aScheme, "wine");
+ return NS_OK;
+ }
+
+ len = WideCharToMultiByte(CP_ACP, 0, This->wine_url, ptr-This->wine_url, scheme,
+ sizeof(scheme), NULL, NULL);
+ scheme[min(len,sizeof(scheme)-1)] = 0;
+ nsACString_SetData(aScheme, strcmp(scheme, "about") ? scheme : "wine");
return NS_OK;
}
More information about the wine-cvs
mailing list