Another dString retired.
This commit is contained in:
22
src/form.cc
22
src/form.cc
@ -678,24 +678,24 @@ void Html_tag_close_textarea(DilloHtml *html)
|
||||
|
||||
if (html->InFlags & IN_TEXTAREA && !S_TOP(html)->display_none) {
|
||||
/* Remove the line ending that follows the opening tag */
|
||||
if (html->Stash->str[0] == '\r')
|
||||
dStr_erase(html->Stash, 0, 1);
|
||||
if (html->Stash->str[0] == '\n')
|
||||
dStr_erase(html->Stash, 0, 1);
|
||||
if (html->Stash[0] == '\r')
|
||||
html->Stash.erase( 0, 1 );
|
||||
if (html->Stash[0] == '\n')
|
||||
html->Stash.erase( 0, 1 );
|
||||
|
||||
/* As the spec recommends to canonicalize line endings, it is safe
|
||||
* to replace '\r' with '\n'. It will be canonicalized anyway! */
|
||||
for (i = 0; i < html->Stash->len; ++i) {
|
||||
if (html->Stash->str[i] == '\r') {
|
||||
if (html->Stash->str[i + 1] == '\n')
|
||||
dStr_erase(html->Stash, i, 1);
|
||||
for (i = 0; i < html->Stash.size(); ++i) {
|
||||
if (html->Stash[i] == '\r') {
|
||||
if (html->Stash[i + 1] == '\n')
|
||||
html->Stash.erase( i, 1 );
|
||||
else
|
||||
html->Stash->str[i] = '\n';
|
||||
html->Stash[i] = '\n';
|
||||
}
|
||||
}
|
||||
|
||||
/* The HTML3.2 spec says it can have "text and character entities". */
|
||||
auto str = a_Html_parse_entities(html, html->Stash->str, html->Stash->len);
|
||||
auto str = a_Html_parse_entities(html, html->Stash.c_str(), html->Stash.size());
|
||||
auto input = Html_get_current_input(*html);
|
||||
if (input) {
|
||||
input->init_str = str;
|
||||
@ -1973,6 +1973,6 @@ static void Html_option_finish(DilloHtml *html)
|
||||
(input->type == DILLO_HTML_INPUT_SELECT ||
|
||||
input->type == DILLO_HTML_INPUT_SEL_LIST)) {
|
||||
DilloHtmlOptbase *opt = input->select->getCurrentOpt ();
|
||||
opt->setContent (html->Stash->str, html->Stash->len);
|
||||
opt->setContent (html->Stash.c_str(), html->Stash.size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user