Plumbing ownership further; some things became C++

This commit is contained in:
2025-04-14 03:48:28 -04:00
parent 76bae93e1c
commit d4a69c0b11
30 changed files with 192 additions and 193 deletions

View File

@ -377,7 +377,7 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
BUG_MSG("<form> requires action attribute.");
action = a_Url_dup(*html->base_url).release();
action = a_Url_dup(html->base_url).release();
}
content_type = DILLO_HTML_ENC_URLENCODED;
if ((method == DILLO_HTML_METHOD_POST) &&
@ -609,7 +609,7 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "action")))
action = a_Html_url_new(html, attrbuf, NULL, 0).release();
else
action = a_Url_dup(*html->base_url).release();
action = a_Url_dup(html->base_url).release();
html->formNew(DILLO_HTML_METHOD_GET, action, DILLO_HTML_ENC_URLENCODED,
html->charset.has_value() ? html->charset.value().c_str() : nullptr);
@ -1005,7 +1005,7 @@ DilloHtmlForm::DilloHtmlForm (DilloHtml *html2,
{
html = html2;
method = method2;
action = a_Url_dup(*action2).release();
action = a_Url_dup(action2).release();
content_type = content_type2;
submit_charset = dStrdup(charset);
num_entry_fields = 0;
@ -1106,10 +1106,10 @@ DilloUrl *DilloHtmlForm::buildQueryUrl(DilloHtmlInput *active_input)
if (method == DILLO_HTML_METHOD_POST) {
new_url = a_Url_new(action_str, NULL).release();
/* new_url keeps the dStr and sets DataStr to NULL */
a_Url_set_data(*new_url, DataStr);
a_Url_set_flags(*new_url, URL_FLAGS(new_url) | URL_Post);
a_Url_set_data(new_url, DataStr);
a_Url_set_flags(new_url, URL_FLAGS(new_url) | URL_Post);
if (content_type == DILLO_HTML_ENC_MULTIPART)
a_Url_set_flags(*new_url, URL_FLAGS(new_url) | URL_MultipartEnc);
a_Url_set_flags(new_url, URL_FLAGS(new_url) | URL_MultipartEnc);
} else {
/* remove <fragment> and <query> sections if present */
char *url_str, *p;
@ -1120,7 +1120,7 @@ DilloUrl *DilloHtmlForm::buildQueryUrl(DilloHtmlInput *active_input)
url_str = dStrconcat(action_str, "?", DataStr.c_str(), NULL);
new_url = a_Url_new(url_str, NULL).release();
a_Url_set_flags(*new_url, URL_FLAGS(new_url) | URL_Get);
a_Url_set_flags(new_url, URL_FLAGS(new_url) | URL_Get);
dFree(url_str);
}
dFree(action_str);