summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2014-08-04 01:10:56 +0000
committercorvid <devnull@localhost>2014-08-04 01:10:56 +0000
commit37a8c614c14c76f1d1e16b1e4f6a7c4c3ecf3f68 (patch)
treee07c57f2f30b444b975457af658181dcaee78e2e
parent02ba033e04c72019be578d011e9cdd64221deb11 (diff)
bug messages: '\n' as separator instead of terminator
Now no extra line at the bottom of the bugs, plus shorter strings.
-rw-r--r--src/form.cc34
-rw-r--r--src/html.cc136
-rw-r--r--src/table.cc22
3 files changed, 97 insertions, 95 deletions
diff --git a/src/form.cc b/src/form.cc
index ac7384aa..b48bb45e 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -343,7 +343,7 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
HT2TB(html)->addParbreak (9, html->wordStyle ());
if (html->InFlags & IN_FORM) {
- BUG_MSG("nested forms\n");
+ BUG_MSG("nested forms");
return;
}
html->InFlags |= IN_FORM;
@@ -356,14 +356,14 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
if (!dStrAsciiCasecmp(attrbuf, "post")) {
method = DILLO_HTML_METHOD_POST;
} else if (dStrAsciiCasecmp(attrbuf, "get")) {
- BUG_MSG("Unknown form submission method \"%s\"\n", attrbuf);
+ BUG_MSG("Unknown form submission method \"%s\"", attrbuf);
}
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "action")))
action = a_Html_url_new(html, attrbuf, NULL, 0);
else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("action attribute is required for <form>\n");
+ BUG_MSG("action attribute is required for <form>");
action = a_Url_dup(html->base_url);
}
content_type = DILLO_HTML_ENC_URLENCODED;
@@ -417,7 +417,7 @@ static int Html_input_get_size(DilloHtml *html, const char *attrbuf)
if (size < 1 || size > MAX_SIZE) {
int badSize = size;
size = (size < 1 ? 20 : MAX_SIZE);
- BUG_MSG("input size=%d, using size=%d instead\n", badSize, size);
+ BUG_MSG("input size=%d, using size=%d instead", badSize, size);
}
}
return size;
@@ -437,11 +437,11 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
ResourceFactory *factory;
if (html->InFlags & IN_SELECT) {
- BUG_MSG("<input> element inside <select>\n");
+ BUG_MSG("<input> element inside <select>");
return;
}
if (html->InFlags & IN_BUTTON) {
- BUG_MSG("<input> element inside <button>\n");
+ BUG_MSG("<input> element inside <button>");
return;
}
@@ -508,12 +508,12 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
DilloHtmlForm *form = html->getCurrentForm();
if (form->method != DILLO_HTML_METHOD_POST) {
valid = false;
- BUG_MSG("Forms with file input MUST use HTTP POST method\n");
+ BUG_MSG("Forms with file input MUST use HTTP POST method");
MSG("File input ignored in form not using HTTP POST method\n");
} else if (form->content_type != DILLO_HTML_ENC_MULTIPART) {
valid = false;
BUG_MSG("Forms with file input MUST use multipart/form-data"
- " encoding\n");
+ " encoding");
MSG("File input ignored in form not using multipart/form-data"
" encoding\n");
}
@@ -645,25 +645,25 @@ void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize)
cols = strtol(attrbuf, NULL, 10);
} else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("cols attribute is required for <textarea>\n");
+ BUG_MSG("cols attribute is required for <textarea>");
cols = 20;
}
if (cols < 1 || cols > MAX_COLS) {
int badCols = cols;
cols = (cols < 1 ? 20 : MAX_COLS);
- BUG_MSG("textarea cols=%d, using cols=%d instead\n", badCols, cols);
+ BUG_MSG("textarea cols=%d, using cols=%d instead", badCols, cols);
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "rows"))) {
rows = strtol(attrbuf, NULL, 10);
} else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("rows attribute is required for <textarea>\n");
+ BUG_MSG("rows attribute is required for <textarea>");
rows = 10;
}
if (rows < 1 || rows > MAX_ROWS) {
int badRows = rows;
rows = (rows < 1 ? 2 : MAX_ROWS);
- BUG_MSG("textarea rows=%d, using rows=%d instead\n", badRows, rows);
+ BUG_MSG("textarea rows=%d, using rows=%d instead", badRows, rows);
}
name = NULL;
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "name")))
@@ -805,11 +805,11 @@ void Html_tag_close_select(DilloHtml *html)
void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize)
{
if (!(html->InFlags & IN_SELECT)) {
- BUG_MSG("<optgroup> element outside <select>\n");
+ BUG_MSG("<optgroup> element outside <select>");
return;
}
if (html->InFlags & IN_OPTGROUP) {
- BUG_MSG("nested <optgroup>\n");
+ BUG_MSG("nested <optgroup>");
return;
}
if (html->InFlags & IN_OPTION) {
@@ -827,7 +827,7 @@ void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize)
bool enabled = (a_Html_get_attr(html, tag, tagsize, "disabled") == NULL);
if (!label) {
- BUG_MSG("label attribute is required for <optgroup>\n");
+ BUG_MSG("label attribute is required for <optgroup>");
label = strdup("");
}
@@ -865,7 +865,7 @@ void Html_tag_close_optgroup(DilloHtml *html)
void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize)
{
if (!(html->InFlags & IN_SELECT)) {
- BUG_MSG("<option> element outside <select>\n");
+ BUG_MSG("<option> element outside <select>");
return;
}
if (html->InFlags & IN_OPTION)
@@ -924,7 +924,7 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
inp_type = DILLO_HTML_INPUT_BUTTON_SUBMIT;
} else {
inp_type = DILLO_HTML_INPUT_UNKNOWN;
- BUG_MSG("Unknown button type: \"%s\"\n", type);
+ BUG_MSG("Unknown button type: \"%s\"", type);
}
if (inp_type != DILLO_HTML_INPUT_UNKNOWN) {
diff --git a/src/html.cc b/src/html.cc
index 28c44dbe..b7eb52c3 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -132,6 +132,8 @@ void DilloHtml::bugMessage(const char *format, ... )
{
va_list argp;
+ if (bw->num_page_bugs)
+ dStr_append_c(bw->page_bugs, '\n');
dStr_sprintfa(bw->page_bugs,
"HTML warning: line %d, ",
getCurrLineNumber());
@@ -158,13 +160,13 @@ DilloUrl *a_Html_url_new(DilloHtml *html,
const char *suffix = (n_ic) > 1 ? "s" : "";
n_ic_spc = URL_ILLEGAL_CHARS_SPC(url);
if (n_ic == n_ic_spc) {
- BUG_MSG("URL has %d illegal space%s ('%s')\n", n_ic, suffix, url_str);
+ BUG_MSG("URL has %d illegal space%s ('%s')", n_ic, suffix, url_str);
} else if (n_ic_spc == 0) {
- BUG_MSG("URL has %d illegal byte%s in {00-1F, 7F-FF} range ('%s')\n",
+ BUG_MSG("URL has %d illegal byte%s in {00-1F, 7F-FF} range ('%s')",
n_ic, suffix, url_str);
} else {
BUG_MSG("URL has %d illegal byte%s: "
- "%d space%s and %d in {00-1F, 7F-FF} range ('%s')\n",
+ "%d space%s and %d in {00-1F, 7F-FF} range ('%s')",
n_ic, suffix,
n_ic_spc, n_ic_spc > 1 ? "s" : "", n_ic-n_ic_spc, url_str);
}
@@ -290,7 +292,7 @@ void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize)
TextAlignType textAlignType = TEXT_ALIGN_LEFT;
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("The align attribute is obsolete in HTML5.\n");
+ BUG_MSG("The align attribute is obsolete in HTML5.");
if (dStrAsciiCasecmp (align, "left") == 0)
textAlignType = TEXT_ALIGN_LEFT;
@@ -334,7 +336,7 @@ bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
if ((attr = a_Html_get_attr(html, tag, tagsize, "valign"))) {
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("The valign attribute is obsolete in HTML5.\n");
+ BUG_MSG("The valign attribute is obsolete in HTML5.");
if (dStrAsciiCasecmp (attr, "top") == 0)
valign = VALIGN_TOP;
@@ -943,7 +945,7 @@ static int Html_parse_entity(DilloHtml *html, const char *token,
if (!isocode || errno || isocode > 0xffff) {
/* this catches null bytes, errors and codes >= 0xFFFF */
- BUG_MSG("numeric character reference \"%s\" out of range\n", tok);
+ BUG_MSG("numeric character reference \"%s\" out of range", tok);
isocode = -2;
}
@@ -951,7 +953,7 @@ static int Html_parse_entity(DilloHtml *html, const char *token,
if (*s == ';')
s++;
else if (prefs.show_extra_warnings)
- BUG_MSG("numeric character reference without trailing ';'\n");
+ BUG_MSG("numeric character reference without trailing ';'");
}
} else if (isalpha(*s)) {
@@ -968,14 +970,14 @@ static int Html_parse_entity(DilloHtml *html, const char *token,
} else {
if ((html->DocType == DT_HTML && html->DocTypeVersion == 4.01f) ||
html->DocType == DT_XHTML)
- BUG_MSG("undefined character entity '%s'\n", tok);
+ BUG_MSG("undefined character entity '%s'", tok);
isocode = -3;
}
}
if (c == ';')
s++;
else if (prefs.show_extra_warnings)
- BUG_MSG("character entity reference without trailing ';'\n");
+ BUG_MSG("character entity reference without trailing ';'");
}
*entsize = s-tok+1;
@@ -985,7 +987,7 @@ static int Html_parse_entity(DilloHtml *html, const char *token,
/* TODO: remove this hack. */
isocode = Html_ms_stupid_quotes_2ucs(isocode);
} else if (isocode == -1 && prefs.show_extra_warnings)
- BUG_MSG("literal '&'\n");
+ BUG_MSG("literal '&'");
return isocode;
}
@@ -1094,7 +1096,7 @@ static void Html_process_space(DilloHtml *html, const char *space,
break;
case '\t':
if (prefs.show_extra_warnings)
- BUG_MSG("TAB character inside <PRE>\n");
+ BUG_MSG("TAB character inside <PRE>");
offset = TAB_SIZE - html->pre_column % TAB_SIZE;
spaceCnt += offset;
html->pre_column += offset;
@@ -1313,7 +1315,7 @@ static void Html_tag_cleanup_to_idx(DilloHtml *html, int idx)
int toptag_idx = S_TOP(html)->tag_idx;
TagInfo toptag = Tags[toptag_idx];
if (s_sz > idx + 1 && toptag.EndTag != 'O')
- BUG_MSG(" - forcing close of open tag: <%s>\n", toptag.name);
+ BUG_MSG(" - forcing close of open tag: <%s>", toptag.name);
_MSG("Close: %*s%s\n", size," ", toptag.name);
if (toptag.close)
toptag.close(html);
@@ -1371,10 +1373,10 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int new_idx)
if (matched) {
Html_tag_cleanup_to_idx(html, stack_idx);
} else if (expected) {
- BUG_MSG("unexpected closing tag: </%s> -- expected </%s>.\n",
+ BUG_MSG("unexpected closing tag: </%s> -- expected </%s>.",
new_tag.name, Tags[tag_idx].name);
} else {
- BUG_MSG("unexpected closing tag: </%s>.\n", new_tag.name);
+ BUG_MSG("unexpected closing tag: </%s>.", new_tag.name);
}
}
@@ -1410,7 +1412,7 @@ static void Html_tag_cleanup_nested_inputs(DilloHtml *html, int new_idx)
}
if (matched) {
- BUG_MSG("attempt to nest <%s> element inside <%s> -- closing <%s>\n",
+ BUG_MSG("attempt to nest <%s> element inside <%s> -- closing <%s>",
Tags[new_idx].name, Tags[u_idx].name, Tags[u_idx].name);
Html_tag_cleanup_to_idx(html, stack_idx);
} else {
@@ -1480,7 +1482,7 @@ CssLength a_Html_parse_length (DilloHtml *html, const char *attr)
else {
/* allow only whitespaces */
if (*end && !isspace (*end)) {
- BUG_MSG("Garbage after length: %s\n", attr);
+ BUG_MSG("Garbage after length: %s", attr);
l = CSS_CREATE_LENGTH(0.0, CSS_LENGTH_TYPE_AUTO);
}
}
@@ -1500,7 +1502,7 @@ int32_t a_Html_color_parse(DilloHtml *html, const char *str,
int32_t color = a_Color_parse(str, default_color, &err);
if (err) {
- BUG_MSG("color \"%s\" is not in \"#RRGGBB\" format\n", str);
+ BUG_MSG("color \"%s\" is not in \"#RRGGBB\" format", str);
}
return color;
}
@@ -1518,7 +1520,7 @@ static int
if (!valid) {
BUG_MSG("'%s' value \"%s\" must not be empty and must not contain "
- "spaces.\n", attrname, val);
+ "spaces.", attrname, val);
}
return valid ? 1 : 0;
} else {
@@ -1530,7 +1532,7 @@ static int
if (val[i] || !(isascii(val[0]) && isalpha(val[0])))
BUG_MSG("'%s' value \"%s\" is not of the form "
- "[A-Za-z][A-Za-z0-9:_.-]*\n", attrname, val);
+ "[A-Za-z][A-Za-z0-9:_.-]*", attrname, val);
return !(val[i]);
}
@@ -1594,7 +1596,7 @@ static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
_MSG("New: {%s}\n", ntag);
if (html->DocType != DT_NONE)
- BUG_MSG("Multiple DOCTYPE declarations.\n");
+ BUG_MSG("Multiple DOCTYPE declarations.");
/* The default DT_NONE type is TagSoup */
if (i > strlen(HTML_SGML_sig) && // avoid out of bounds reads!
@@ -1633,7 +1635,7 @@ static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
}
if (html->DocType == DT_NONE) {
html->DocType = DT_UNRECOGNIZED;
- BUG_MSG("DOCTYPE not recognized:\n%s.\n", ntag);
+ BUG_MSG("DOCTYPE not recognized:\n%s.", ntag);
}
dFree(ntag);
}
@@ -1652,7 +1654,7 @@ static void Html_tag_open_html(DilloHtml *html, const char *tag, int tagsize)
++html->Num_HTML;
if (html->Num_HTML > 1) {
- BUG_MSG("HTML element was already open\n");
+ BUG_MSG("HTML element was already open");
html->ReqTagClose = true;
}
}
@@ -1671,7 +1673,7 @@ static void Html_tag_close_html(DilloHtml *html)
static void Html_tag_open_head(DilloHtml *html, const char *tag, int tagsize)
{
if (html->InFlags & IN_BODY) {
- BUG_MSG("HEAD element must go before the BODY section\n");
+ BUG_MSG("HEAD element must go before the BODY section");
html->ReqTagClose = true;
return;
}
@@ -1679,10 +1681,10 @@ static void Html_tag_open_head(DilloHtml *html, const char *tag, int tagsize)
if (html->Num_HEAD < UCHAR_MAX)
++html->Num_HEAD;
if (html->InFlags & IN_HEAD) {
- BUG_MSG("HEAD element was already open\n");
+ BUG_MSG("HEAD element was already open");
html->ReqTagClose = true;
} else if (html->Num_HEAD > 1) {
- BUG_MSG("HEAD section already finished -- ignoring\n");
+ BUG_MSG("HEAD section already finished -- ignoring");
html->ReqTagClose = true;
} else {
html->InFlags |= IN_HEAD;
@@ -1699,7 +1701,7 @@ static void Html_tag_close_head(DilloHtml *html)
if (html->Num_HEAD == 1) {
/* match for the well formed start of HEAD section */
if (html->Num_TITLE == 0)
- BUG_MSG("HEAD section lacks the TITLE element\n");
+ BUG_MSG("HEAD section lacks the TITLE element");
html->InFlags &= ~IN_HEAD;
@@ -1729,9 +1731,9 @@ static void Html_tag_open_title(DilloHtml *html, const char *tag, int tagsize)
if (html->Num_TITLE < UCHAR_MAX)
++html->Num_TITLE;
if (html->Num_TITLE > 1)
- BUG_MSG("A redundant TITLE element was found\n");
+ BUG_MSG("A redundant TITLE element was found");
} else {
- BUG_MSG("TITLE element must be inside the HEAD section -- ignoring\n");
+ BUG_MSG("TITLE element must be inside the HEAD section -- ignoring");
}
}
@@ -1779,7 +1781,7 @@ static void Html_tag_open_style(DilloHtml *html, const char *tag, int tagsize)
if (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "type"))) {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("type attribute is required for <style>\n");
+ BUG_MSG("type attribute is required for <style>");
} else if (dStrAsciiCasecmp(attrbuf, "text/css")) {
html->loadCssFromStash = false;
}
@@ -1828,21 +1830,21 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
++html->Num_BODY;
if (html->Num_BODY > 1) {
- BUG_MSG("BODY element was already open\n");
+ BUG_MSG("BODY element was already open");
html->ReqTagClose = true;
return;
}
if (html->InFlags & IN_HEAD) {
/* if we're here, it's bad XHTML, no need to recover */
- BUG_MSG("unclosed HEAD element\n");
+ BUG_MSG("unclosed HEAD element");
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
color = a_Html_color_parse(html, attrbuf, -1);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<body> bgcolor attribute is obsolete.\n");
+ BUG_MSG("<body> bgcolor attribute is obsolete.");
if (color != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
@@ -1853,7 +1855,7 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
color = a_Html_color_parse(html, attrbuf, -1);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<body> text attribute is obsolete.\n");
+ BUG_MSG("<body> text attribute is obsolete.");
if (color != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_COLOR,
@@ -1865,13 +1867,13 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "link"))) {
html->non_css_link_color = a_Html_color_parse(html, attrbuf, -1);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<body> link attribute is obsolete.\n");
+ BUG_MSG("<body> link attribute is obsolete.");
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "vlink"))) {
html->non_css_visited_color = a_Html_color_parse(html, attrbuf, -1);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<body> vlink attribute is obsolete.\n");
+ BUG_MSG("<body> vlink attribute is obsolete.");
}
html->dw->setStyle (html->style ());
@@ -2341,7 +2343,7 @@ static void Html_tag_content_map(DilloHtml *html, const char *tag, int tagsize)
DilloUrl *url;
if (html->InFlags & IN_MAP) {
- BUG_MSG("nested <map>\n");
+ BUG_MSG("nested <map>");
} else {
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "name"))) {
html->InFlags |= IN_MAP;
@@ -2351,7 +2353,7 @@ static void Html_tag_content_map(DilloHtml *html, const char *tag, int tagsize)
a_Url_free (url);
dFree(hash_name);
} else {
- BUG_MSG("name attribute is required for <map>\n");
+ BUG_MSG("name attribute is required for <map>");
}
}
}
@@ -2403,7 +2405,7 @@ misc::SimpleVector<int> *Html_read_coords(DilloHtml *html, const char *str)
if (!*newtail)
break;
if (*newtail != ',') {
- BUG_MSG("area coords must be integers separated by commas.\n");
+ BUG_MSG("area coords must be integers separated by commas.");
}
tail = newtail + 1;
}
@@ -2426,7 +2428,7 @@ static void
Shape *shape = NULL;
if (!(html->InFlags & IN_MAP)) {
- BUG_MSG("<area> element not inside <map>\n");
+ BUG_MSG("<area> element not inside <map>");
return;
}
attrbuf = a_Html_get_attr(html, tag, tagsize, "shape");
@@ -2442,7 +2444,7 @@ static void
} else if (dStrnAsciiCasecmp(attrbuf, "poly", 4) == 0) {
type = POLYGON;
} else {
- BUG_MSG("<area> unknown shape: \"%s\"\n", attrbuf);
+ BUG_MSG("<area> unknown shape: \"%s\"", attrbuf);
type = UNKNOWN;
}
if (type == RECTANGLE || type == CIRCLE || type == POLYGON) {
@@ -2452,7 +2454,7 @@ static void
if (type == RECTANGLE) {
if (coords->size() != 4)
- BUG_MSG("<area> rectangle must have four coordinate values\n");
+ BUG_MSG("<area> rectangle must have four coordinate values");
if (coords->size() >= 4)
shape = new Rectangle(coords->get(0),
coords->get(1),
@@ -2460,7 +2462,7 @@ static void
coords->get(3) - coords->get(1));
} else if (type == CIRCLE) {
if (coords->size() != 3)
- BUG_MSG("<area> circle must have three coordinate values\n");
+ BUG_MSG("<area> circle must have three coordinate values");
if (coords->size() >= 3)
shape = new Circle(coords->get(0), coords->get(1),
coords->get(2));
@@ -2468,7 +2470,7 @@ static void
Polygon *poly;
int i;
if (coords->size() % 2)
- BUG_MSG("<area> polygon with odd number of coordinates\n");
+ BUG_MSG("<area> polygon with odd number of coordinates");
shape = poly = new Polygon();
for (i = 0; i < (coords->size() / 2); i++)
poly->addPoint(coords->get(2*i), coords->get(2*i + 1));
@@ -2604,11 +2606,11 @@ static void Html_tag_open_source(DilloHtml *html, const char *tag,
const char *attrbuf;
if (!(html->InFlags & IN_MEDIA)) {
- BUG_MSG("<source> element not inside a media element.\n");
+ BUG_MSG("<source> element not inside a media element.");
return;
}
if (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "src"))) {
- BUG_MSG("src attribute is required in <source> element.\n");
+ BUG_MSG("src attribute is required in <source> element.");
return;
} else {
DilloUrl *url = a_Html_url_new(html, attrbuf, NULL, 0);
@@ -2685,7 +2687,7 @@ static const char* Html_get_javascript_link(DilloHtml *html)
if ((ch == '"' || ch == '\'') &&
(p2 = strchr(Buf->str + i + 1 , ch))) {
p1 = Buf->str + i;
- BUG_MSG("link depends on javascript()\n");
+ BUG_MSG("link depends on javascript()");
dStr_truncate(Buf, p2 - Buf->str);
dStr_erase(Buf, 0, p1 - Buf->str + 1);
}
@@ -2700,7 +2702,7 @@ static void Html_add_anchor(DilloHtml *html, const char *name)
{
_MSG("Registering ANCHOR: %s\n", name);
if (!HT2TB(html)->addAnchor (name, html->style ()))
- BUG_MSG("Anchor names must be unique within the document ('%s')\n",name);
+ BUG_MSG("Anchor names must be unique within the document ('%s')",name);
/*
* According to Sec. 12.2.1 of the HTML 4.01 spec, "anchor names that
* differ only in case may not appear in the same document", but
@@ -2771,7 +2773,7 @@ static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize)
if (!id || strcmp(nameVal, id)) {
if (id)
BUG_MSG("id ('%s') and name ('%s') attributes of <a> tag "
- "differ\n", id, nameVal);
+ "differ", id, nameVal);
Html_add_anchor(html, nameVal);
}
@@ -2847,7 +2849,7 @@ static void Html_tag_open_ul(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (CSS_PROPERTY_LIST_STYLE_TYPE,
CSS_TYPE_ENUM, list_style_type);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<ul> type attribute is obsolete.\n");
+ BUG_MSG("<ul> type attribute is obsolete.");
}
S_TOP(html)->list_type = HTML_LIST_UNORDERED;
@@ -2869,7 +2871,7 @@ static void Html_tag_open_dir(DilloHtml *html, const char *tag, int tagsize)
S_TOP(html)->ref_list_item = NULL;
if (prefs.show_extra_warnings)
- BUG_MSG("Obsolete list type; use <UL> instead\n");
+ BUG_MSG("Obsolete list type; use <UL> instead");
}
/*
@@ -2919,7 +2921,7 @@ static void Html_tag_open_ol(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "start")) &&
(n = (int) strtol(attrbuf, NULL, 10)) < 0) {
- BUG_MSG( "illegal '-' character in START attribute; Starting from 0\n");
+ BUG_MSG( "illegal '-' character in START attribute; Starting from 0");
n = 0;
}
S_TOP(html)->list_number = n;
@@ -2936,7 +2938,7 @@ static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize)
const char *attrbuf;
if (S_TOP(html)->list_type == HTML_LIST_NONE)
- BUG_MSG("<li> outside <ul> or <ol>\n");
+ BUG_MSG("<li> outside <ul> or <ol>");
html->InFlags |= IN_LI;
@@ -2947,7 +2949,7 @@ static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize)
// ordered
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "value")) &&
(*list_number = strtol(attrbuf, NULL, 10)) < 0) {
- BUG_MSG("illegal negative LIST VALUE attribute; Starting from 0\n");
+ BUG_MSG("illegal negative LIST VALUE attribute; Starting from 0");
*list_number = 0;
}
}
@@ -2974,7 +2976,7 @@ static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
width_ptr = a_Html_get_attr_wdef(html, tag, tagsize, "width", NULL);
if (width_ptr) {
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<hr> width attribute is obsolete.\n");
+ BUG_MSG("<hr> width attribute is obsolete.");
html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
CSS_TYPE_LENGTH_PERCENTAGE,
a_Html_parse_length (html, width_ptr));
@@ -2984,7 +2986,7 @@ static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "size"))) {
size = strtol(attrbuf, NULL, 10);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<hr> size attribute is obsolete.\n");
+ BUG_MSG("<hr> size attribute is obsolete.");
}
a_Html_tag_set_align_attr(html, tag, tagsize);
@@ -2992,7 +2994,7 @@ static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
/* TODO: evaluate attribute */
if (a_Html_get_attr(html, tag, tagsize, "noshade")) {
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<hr> noshade attribute is obsolete.\n");
+ BUG_MSG("<hr> noshade attribute is obsolete.");
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_STYLE,
CSS_TYPE_ENUM, BORDER_SOLID);
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
@@ -3147,7 +3149,7 @@ static void Html_tag_open_meta(DilloHtml *html, const char *tag, int tagsize)
/* only valid inside HEAD */
if (!(html->InFlags & IN_HEAD)) {
- BUG_MSG("META element must be inside the HEAD section\n");
+ BUG_MSG("META element must be inside the HEAD section");
return;
}
@@ -3180,7 +3182,7 @@ static void Html_tag_open_meta(DilloHtml *html, const char *tag, int tagsize)
if (a_Url_cmp(html->base_url, new_url) == 0) {
/* redirection loop, or empty url string: ignore */
- BUG_MSG("META refresh: %s\n",
+ BUG_MSG("META refresh: %s",
*mr_url ? "redirection loop" : "no target URL");
} else if (delay == 0) {
/* zero-delay redirection */
@@ -3309,7 +3311,7 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize)
/* Ignore LINK outside HEAD */
if (!(html->InFlags & IN_HEAD)) {
- BUG_MSG("LINK element must be inside the HEAD section\n");
+ BUG_MSG("LINK element must be inside the HEAD section");
return;
}
/* Remote stylesheets enabled? */
@@ -3354,12 +3356,12 @@ static void Html_tag_open_base(DilloHtml *html, const char *tag, int tagsize)
a_Url_free(html->base_url);
html->base_url = BaseUrl;
} else {
- BUG_MSG("base URI is relative (it MUST be absolute)\n");
+ BUG_MSG("base URI is relative (it MUST be absolute)");
a_Url_free(BaseUrl);
}
}
} else {
- BUG_MSG("the BASE element must appear in the HEAD section\n");
+ BUG_MSG("the BASE element must appear in the HEAD section");
}
}
@@ -3705,7 +3707,7 @@ static void Html_stack_cleanup_at_open(DilloHtml *html, int new_idx)
/* we have an inline (or empty) container... */
if (Tags[oldtag_idx].EndTag == 'R') {
- BUG_MSG("<%s> is not allowed to contain <%s>. -- closing <%s>\n",
+ BUG_MSG("<%s> is not allowed to contain <%s>. -- closing <%s>",
Tags[oldtag_idx].name, Tags[new_idx].name,
Tags[oldtag_idx].name);
}
@@ -3734,7 +3736,7 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag)
int tag_idx;
if (!(html->InFlags & IN_HTML) && html->DocType == DT_NONE)
- BUG_MSG("the required DOCTYPE declaration is missing.\n");
+ BUG_MSG("the required DOCTYPE declaration is missing.");
if (!(html->InFlags & IN_HTML)) {
tag = "<html>";
@@ -3852,7 +3854,7 @@ static void Html_check_html5_obsolete(DilloHtml *html, int ni)
}
for (int i = 0; i < 9; i++) {
if (indexes[i] == ni) {
- BUG_MSG("<%s> is obsolete in HTML5.\n", Tags[ni].name);
+ BUG_MSG("<%s> is obsolete in HTML5.", Tags[ni].name);
break;
}
}
@@ -3942,7 +3944,7 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize)
/* TODO: this is only raising a warning, take some defined action.
* Note: apache uses IMG inside PRE (we could use its "alt"). */
if ((html->InFlags & IN_PRE) && Html_tag_pre_excludes(ni))
- BUG_MSG("<pre> is not allowed to contain <%s>\n", Tags[ni].name);
+ BUG_MSG("<pre> is not allowed to contain <%s>", Tags[ni].name);
/* Make sure these elements don't nest each other */
if (html->InFlags & (IN_BUTTON | IN_SELECT | IN_TEXTAREA))
@@ -4272,7 +4274,7 @@ static int Html_write_raw(DilloHtml *html, char *buf, int bufsize, int Eof)
if (buf[offset] == ch || !buf[offset]) {
buf_index = offset;
} else {
- BUG_MSG("attribute lacks closing quote\n");
+ BUG_MSG("attribute lacks closing quote");
break;
}
}
@@ -4280,7 +4282,7 @@ static int Html_write_raw(DilloHtml *html, char *buf, int bufsize, int Eof)
/* unterminated tag detected */
p = dStrndup(buf+token_start+1,
strcspn(buf+token_start+1, " <\n\r\t"));
- BUG_MSG("<%s> element lacks its closing '>'\n", p);
+ BUG_MSG("<%s> element lacks its closing '>'", p);
dFree(p);
--buf_index;
break;
diff --git a/src/table.cc b/src/table.cc
index a3002ebf..a663b138 100644
--- a/src/table.cc
+++ b/src/table.cc
@@ -48,13 +48,13 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cellspacing"))) {
cellspacing = strtol (attrbuf, NULL, 10);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<table> cellspacing attribute is obsolete.\n");
+ BUG_MSG("<table> cellspacing attribute is obsolete.");
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cellpadding"))) {
cellpadding = strtol (attrbuf, NULL, 10);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<table> cellpadding attribute is obsolete.\n");
+ BUG_MSG("<table> cellpadding attribute is obsolete.");
}
if (border != -1) {
@@ -88,7 +88,7 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
CSS_TYPE_LENGTH_PERCENTAGE,
a_Html_parse_length (html, attrbuf));
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<table> width attribute is obsolete.\n");
+ BUG_MSG("<table> width attribute is obsolete.");
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "align"))) {
@@ -102,7 +102,7 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
CSS_TYPE_ENUM, TEXT_ALIGN_CENTER);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<table> align attribute is obsolete.\n");
+ BUG_MSG("<table> align attribute is obsolete.");
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
@@ -111,7 +111,7 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, bgcolor);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<table> bgcolor attribute is obsolete.\n");
+ BUG_MSG("<table> bgcolor attribute is obsolete.");
}
html->style (); // evaluate now, so we can build non-css hints for the cells
@@ -192,7 +192,7 @@ void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, bgcolor);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<tr> bgcolor attribute is obsolete.\n");
+ BUG_MSG("<tr> bgcolor attribute is obsolete.");
}
if (a_Html_get_attr (html, tag, tagsize, "align")) {
@@ -379,7 +379,7 @@ static void Html_tag_open_table_cell(DilloHtml *html,
}
if (a_Html_get_attr(html, tag, tagsize, "nowrap")) {
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<t%c> nowrap attribute is obsolete.\n",
+ BUG_MSG("<t%c> nowrap attribute is obsolete.",
(tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
html->styleEngine->setNonCssHint(CSS_PROPERTY_WHITE_SPACE,
CSS_TYPE_ENUM, WHITE_SPACE_NOWRAP);
@@ -392,7 +392,7 @@ static void Html_tag_open_table_cell(DilloHtml *html,
CSS_TYPE_LENGTH_PERCENTAGE,
a_Html_parse_length (html, attrbuf));
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<t%c> width attribute is obsolete.\n",
+ BUG_MSG("<t%c> width attribute is obsolete.",
(tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
}
@@ -404,7 +404,7 @@ static void Html_tag_open_table_cell(DilloHtml *html,
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, bgcolor);
if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
- BUG_MSG("<t%c> bgcolor attribute is obsolete.\n",
+ BUG_MSG("<t%c> bgcolor attribute is obsolete.",
(tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
}
@@ -423,12 +423,12 @@ static void Html_tag_content_table_cell(DilloHtml *html,
switch (S_TOP(html)->table_mode) {
case DILLO_HTML_TABLE_MODE_NONE:
- BUG_MSG("<t%c> outside <table>\n",
+ BUG_MSG("<t%c> outside <table>",
(tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
return;
case DILLO_HTML_TABLE_MODE_TOP:
- BUG_MSG("<t%c> outside <tr>\n",
+ BUG_MSG("<t%c> outside <tr>",
(tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
/* a_Dw_table_add_cell takes care that dillo does not crash. */
/* continues */