diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-03-06 21:44:15 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-03-06 21:44:15 +0100 |
commit | fa2c1752a10a86b52e4cead93843616fba44346a (patch) | |
tree | da85cd088de000f14b22620438f3c8cc915829ca | |
parent | 53336f25a66b8325e1f43d9ce5f23e6e1e6a7279 (diff) |
fix CSS string parsing bug
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/cssparser.cc | 15 |
2 files changed, 7 insertions, 9 deletions
@@ -67,6 +67,7 @@ dillo-2.1 - Reduce number of styleEngine::style0() calls. - Replace bg_color dillorc option. - Remove text_color, link_color, and force_my_colors dillorc options. + - Fix CSS string parsing bug. Patches: Johannes Hofmann +- Updated the GPL copyright note in the source files. Patch: Detlef Riekenberg diff --git a/src/cssparser.cc b/src/cssparser.cc index db0c2961..e4637099 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -396,7 +396,6 @@ static void Css_next_token(CssParser * parser) { int c, c1, d, j; char hexbuf[5]; - bool escaped; int i = 0; parser->ttype = CSS_TK_CHAR; /* init */ @@ -501,11 +500,9 @@ static void Css_next_token(CssParser * parser) i = 0; c = Css_getc(parser); - escaped = false; - while (c != EOF && (escaped || c != c1)) { + while (c != EOF && c != c1) { if (c == '\\') { - escaped = true; d = Css_getc(parser); if (isxdigit(d)) { /* Read hex Unicode char. (Actually, strings are yet only 8 @@ -521,11 +518,11 @@ static void Css_next_token(CssParser * parser) hexbuf[j] = 0; Css_ungetc(parser); c = strtol(hexbuf, NULL, 16); - } else - /* Take next character literally. */ - c = Css_getc(parser); - } else - escaped = false; + } else { + /* Take character literally. */ + c = d; + } + } if (i < MAX_STR_LEN - 1) { parser->tval[i] = c; |