Jacek Caban (@jacek) commented about dlls/mshtml/htmlevent.c:
- hres = IHTMLLocation_get_href(location, &bstr);
- IHTMLLocation_Release(location); if(FAILED(hres)) return hres;
- if(bstr) {
static const WCHAR delims[] = L"/\\";
if(bstr[len] == '/' && bstr[len + 1] == '/')
len += 2 + wcscspn(bstr + len + 2, delims);
origin = SysAllocStringLen(bstr, len);
SysFreeString(bstr);
if(!origin)
return E_OUTOFMEMORY;
- }
A partial reparsing of `get_href` here doesn't seem right. It seems that you could use `get_host` instead, but perhaps it would be easier to just use IUri interface instead.