summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDodji <dodji@gnome.org>2004-03-06 22:49:56 +0000
committerDodji Seketeli <dodji@src.gnome.org>2004-03-06 22:49:56 +0000
commit9fd0686e5a84f3c62e3a3ce4c11777e4f2050cb7 (patch)
tree95ec9181b898929edb2f561ac6e71a000b9a21a6 /src
parent406526f52125bbf6dbf95eee6f01655544a70b24 (diff)
downloadlibcroco-9fd0686e5a84f3c62e3a3ce4c11777e4f2050cb7.tar.gz
when you reach an EOF, don't assume it's an error. Return the already
2004-03-06 Dodji <dodji@gnome.org> * src/cr-tknzr.c: (cr_tknzr_parse_num): when you reach an EOF, don't assume it's an error. Return the already parsed part of the number. Next attempt of parsing will result in an * tests/test4-main.c: udpated this test the fix made above. CR_END_OF_INPUT_ERROR.
Diffstat (limited to 'src')
-rw-r--r--src/cr-parser.c2
-rw-r--r--src/cr-term.c1
-rw-r--r--src/cr-tknzr.c10
3 files changed, 9 insertions, 4 deletions
diff --git a/src/cr-parser.c b/src/cr-parser.c
index 6b1bb2a..67e51be 100644
--- a/src/cr-parser.c
+++ b/src/cr-parser.c
@@ -3722,7 +3722,7 @@ cr_parser_parse_expr (CRParser *a_this, CRTerm **a_expr)
{
goto error ;
}
- */
+ */
status = CR_OK ;
break ;
}
diff --git a/src/cr-term.c b/src/cr-term.c
index 6f5ae9f..7bfab93 100644
--- a/src/cr-term.c
+++ b/src/cr-term.c
@@ -131,7 +131,6 @@ cr_term_parse_expression_from_buf (const guchar *a_buf,
{
goto cleanup ;
}
-
status = cr_parser_parse_expr (parser, &result) ;
if (status != CR_OK)
{
diff --git a/src/cr-tknzr.c b/src/cr-tknzr.c
index 2b9e06f..8bcc349 100644
--- a/src/cr-tknzr.c
+++ b/src/cr-tknzr.c
@@ -1677,8 +1677,14 @@ cr_tknzr_parse_num (CRTknzr *a_this, CRNum ** a_num)
for (;;)
{
- PEEK_NEXT_CHAR (a_this, &next_char) ;
-
+ status = cr_tknzr_peek_char (a_this,
+ &next_char) ;
+ if (status != CR_OK)
+ {
+ if (status == CR_END_OF_INPUT_ERROR)
+ status = CR_OK ;
+ break ;
+ }
if (next_char == '.')
{
if (parsing_dec == TRUE)