From 9c6e96d743c993f1b92f0cc2f07164d44780536e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 9 Nov 2008 17:40:40 +0000 Subject: Return errors from tokeniser constructor/destructor svn path=/trunk/hubbub/; revision=5664 --- src/parser.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 342f19b..b67e9d1 100644 --- a/src/parser.c +++ b/src/parser.c @@ -41,6 +41,7 @@ hubbub_parser *hubbub_parser_create(const char *enc, bool fix_enc, hubbub_alloc alloc, void *pw) { parserutils_error perror; + hubbub_error error; hubbub_parser *parser; if (alloc == NULL) @@ -71,11 +72,12 @@ hubbub_parser *hubbub_parser_create(const char *enc, bool fix_enc, return NULL; } - parser->tok = hubbub_tokeniser_create(parser->stream, alloc, pw); - if (parser->tok == NULL) { + error = hubbub_tokeniser_create(parser->stream, alloc, pw, + &parser->tok); + if (error != HUBBUB_OK) { parserutils_inputstream_destroy(parser->stream); alloc(parser, 0, pw); - return NULL; + return NULL; /// } parser->tb = hubbub_treebuilder_create(parser->tok, alloc, pw); -- cgit v1.2.3