aboutsummaryrefslogtreecommitdiff
path: root/src/cssparser.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-06 21:44:15 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-06 21:44:15 +0100
commitfa2c1752a10a86b52e4cead93843616fba44346a (patch)
treeda85cd088de000f14b22620438f3c8cc915829ca /src/cssparser.cc
parent53336f25a66b8325e1f43d9ce5f23e6e1e6a7279 (diff)
fix CSS string parsing bug
Diffstat (limited to 'src/cssparser.cc')
-rw-r--r--src/cssparser.cc15
1 files changed, 6 insertions, 9 deletions
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;