summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-05-27 14:22:59 (GMT)
committer John Mark Bell <jmb@netsurf-browser.org>2009-05-27 14:22:59 (GMT)
commit15e72d831d9af99a5a7a593f39863511bd612d4b (patch)
tree25d26a8fc2c8be2cda044c112bd413aad2cf01b9
parent6f8a2061ce1356bc0cd31e6946e37cf75b9c7094 (diff)
downloadlibhubbub-15e72d831d9af99a5a7a593f39863511bd612d4b.tar.gz
libhubbub-15e72d831d9af99a5a7a593f39863511bd612d4b.tar.bz2
Make assignment of doctype component pointers clearer. Also removes a redundant pointer increment.
svn path=/trunk/hubbub/; revision=7581
-rw-r--r--src/tokeniser/tokeniser.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tokeniser/tokeniser.c b/src/tokeniser/tokeniser.c
index 7c2f6f0..e75621d 100644
--- a/src/tokeniser/tokeniser.c
+++ b/src/tokeniser/tokeniser.c
@@ -3268,7 +3268,6 @@ hubbub_error emit_current_doctype(hubbub_tokeniser *tokeniser,
bool force_quirks)
{
hubbub_token token;
- uint8_t *ptr;
/* Emit doctype */
token.type = HUBBUB_TOKEN_DOCTYPE;
@@ -3277,19 +3276,17 @@ hubbub_error emit_current_doctype(hubbub_tokeniser *tokeniser,
token.data.doctype.force_quirks = true;
/* Set pointers correctly */
- ptr = tokeniser->buffer->data;
-
- token.data.doctype.name.ptr = ptr;
- ptr += token.data.doctype.name.len;
+ token.data.doctype.name.ptr = tokeniser->buffer->data;
if (token.data.doctype.public_missing == false) {
- token.data.doctype.public_id.ptr = ptr;
- ptr += token.data.doctype.public_id.len;
+ token.data.doctype.public_id.ptr = tokeniser->buffer->data +
+ token.data.doctype.name.len;
}
if (token.data.doctype.system_missing == false) {
- token.data.doctype.system_id.ptr = ptr;
- ptr += token.data.doctype.system_id.len;
+ token.data.doctype.system_id.ptr = tokeniser->buffer->data +
+ token.data.doctype.name.len +
+ token.data.doctype.public_id.len;
}
return hubbub_tokeniser_emit_token(tokeniser, &token);