summaryrefslogtreecommitdiff
path: root/src/treebuilder
diff options
context:
space:
mode:
authorAndrew Sidwell <andy@entai.co.uk>2008-08-11 01:29:00 +0000
committerAndrew Sidwell <andy@entai.co.uk>2008-08-11 01:29:00 +0000
commita6c3624c75a547e142fc732898f9a3890fa9e2f5 (patch)
tree6e1b44c51a706843d2057e3e1126ffa5714becf1 /src/treebuilder
parent4aef3c775e93d5add0277941fe0ecccc91d4ccb3 (diff)
downloadlibhubbub-a6c3624c75a547e142fc732898f9a3890fa9e2f5.tar.gz
libhubbub-a6c3624c75a547e142fc732898f9a3890fa9e2f5.tar.bz2
Move one step closer to getting encoding changes working.
svn path=/trunk/hubbub/; revision=5000
Diffstat (limited to 'src/treebuilder')
-rw-r--r--src/treebuilder/in_head.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/treebuilder/in_head.c b/src/treebuilder/in_head.c
index 88fcff5..897610b 100644
--- a/src/treebuilder/in_head.c
+++ b/src/treebuilder/in_head.c
@@ -64,20 +64,26 @@ static hubbub_error process_meta_in_head(hubbub_treebuilder *treebuilder,
if (treebuilder->tree_handler->encoding_change) {
const char *name = parserutils_charset_mibenum_to_name(
charset_enc);
- treebuilder->tree_handler->encoding_change(
+
+ /* 1 indicates the encoding should actually change */
+ if (treebuilder->tree_handler->encoding_change(
treebuilder->tree_handler->ctx,
- name);
+ name) == 1) {
+ return HUBBUB_ENCODINGCHANGE;
+ }
}
- return HUBBUB_ENCODINGCHANGE;
} else if (content_type_enc != 0) {
if (treebuilder->tree_handler->encoding_change) {
const char *name = parserutils_charset_mibenum_to_name(
content_type_enc);
- treebuilder->tree_handler->encoding_change(
+
+ /* 1 indicates the encoding should actually change */
+ if (treebuilder->tree_handler->encoding_change(
treebuilder->tree_handler->ctx,
- name);
+ name) == 1) {
+ return HUBBUB_ENCODINGCHANGE;
+ }
}
- return HUBBUB_ENCODINGCHANGE;
}
return HUBBUB_OK;