diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-22 00:35:22 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-22 00:35:22 +0000 |
commit | e5155a018dc862b12851fcfed0c9c916373865c5 (patch) | |
tree | 9af1fa20af4a88dc8efd802ba29765a79396db23 | |
parent | 5a5f84496e16117e8b5b992dcb07e51e637890cb (diff) | |
download | libcss-e5155a018dc862b12851fcfed0c9c916373865c5.tar.gz libcss-e5155a018dc862b12851fcfed0c9c916373865c5.tar.bz2 |
Fix handling of EOF in property values
svn path=/trunk/libcss/; revision=6165
-rw-r--r-- | src/parse/parse.c | 6 | ||||
-rw-r--r-- | test/data/parse2/eof.dat | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/parse/parse.c b/src/parse/parse.c index 825f019..9ea6064 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -1639,6 +1639,9 @@ css_error parseValue0(css_parser *parser) if (error != CSS_OK) return error; + if (token->type == CSS_TOKEN_EOF) + return done(parser); + /* Grammar ambiguity -- assume ';' or '}' mark end */ if (token->type == CSS_TOKEN_CHAR && token->ilower->len == 1 && @@ -1741,6 +1744,9 @@ css_error parseAny0(css_parser *parser) if (error != CSS_OK) return error; + if (token->type == CSS_TOKEN_EOF) + return done(parser); + /* Grammar ambiguity: * assume '{', ';', ')', ']' mark end */ if (token->type == CSS_TOKEN_CHAR && diff --git a/test/data/parse2/eof.dat b/test/data/parse2/eof.dat index e2c8e6b..fb25273 100644 --- a/test/data/parse2/eof.dat +++ b/test/data/parse2/eof.dat @@ -99,10 +99,11 @@ f{g: #reset #data -f{g:h +f{clear:both #errors #expected | f +| clear: both #reset #data |