From 793b021fd0133dda8d77d16def9e185054492500 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 18 Aug 2010 13:37:56 +0200 Subject: [PATCH] mshtml: Use fake scheme only for about protocol in nsIURI::GetScheme. --- dlls/mshtml/nsio.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 986cc76eba..d7b09896ba 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; }