Commit 88f9fcf1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fixed nsAString handling in navigate_anchor.

parent a61145f2
......@@ -44,13 +44,13 @@ typedef struct {
static HRESULT navigate_anchor(HTMLAnchorElement *This)
{
nsAString href_str, target_str;
const PRUnichar *href, *target;
nsresult nsres;
HRESULT hres;
nsAString_Init(&target_str, NULL);
nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str);
if(NS_FAILED(nsres))
return E_FAIL;
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *target;
nsAString_GetData(&target_str, &target);
if(*target) {
......@@ -58,12 +58,13 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
nsAString_Finish(&target_str);
return S_OK;
}
}
nsAString_Finish(&target_str);
nsAString_Init(&href_str, NULL);
nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str);
if(NS_FAILED(nsres))
return E_FAIL;
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *href;
nsAString_GetData(&href_str, &href);
if(*href) {
......@@ -73,7 +74,7 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
TRACE("empty href\n");
hres = S_OK;
}
}
nsAString_Finish(&href_str);
return hres;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment