hhctrl.ocx: Correctly handle URLs in SetChmPath.

This commit is contained in:
Jacek Caban 2007-03-02 18:19:48 +01:00 committed by Alexandre Julliard
parent 1bfbcefb60
commit e18ddbc0cd

View file

@ -249,11 +249,29 @@ done:
return SUCCEEDED(hr); return SUCCEEDED(hr);
} }
static LPCWSTR skip_schema(LPCWSTR url)
{
static const WCHAR its_schema[] = {'i','t','s',':'};
static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'};
static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'};
if(!strncmpiW(its_schema, url, sizeof(its_schema)/sizeof(WCHAR)))
return url+sizeof(its_schema)/sizeof(WCHAR);
if(!strncmpiW(msits_schema, url, sizeof(msits_schema)/sizeof(WCHAR)))
return url+sizeof(msits_schema)/sizeof(WCHAR);
if(!strncmpiW(mk_schema, url, sizeof(mk_schema)/sizeof(WCHAR)))
return url+sizeof(mk_schema)/sizeof(WCHAR);
return url;
}
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path) void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
{ {
LPCWSTR ptr; LPCWSTR ptr;
static const WCHAR separatorW[] = {':',':',0}; static const WCHAR separatorW[] = {':',':',0};
path = skip_schema(path);
ptr = strstrW(path, separatorW); ptr = strstrW(path, separatorW);
if(ptr) { if(ptr) {
WCHAR chm_file[MAX_PATH]; WCHAR chm_file[MAX_PATH];