diff options
author | Andrew Sidwell <andy@entai.co.uk> | 2008-06-17 02:38:08 +0000 |
---|---|---|
committer | Andrew Sidwell <andy@entai.co.uk> | 2008-06-17 02:38:08 +0000 |
commit | aa00e463d9182a29337e6f5882bba013200350ca (patch) | |
tree | 2f7b07faf2db022902c252078ac5ebd22517029b | |
parent | e0dbf01a17ab0fe3cacf0e2112f4497399b06793 (diff) | |
download | libhubbub-aa00e463d9182a29337e6f5882bba013200350ca.tar.gz libhubbub-aa00e463d9182a29337e6f5882bba013200350ca.tar.bz2 |
Fix up the comment start dash state a bit; now on the third set of tests.
svn path=/trunk/hubbub/; revision=4369
-rw-r--r-- | src/tokeniser/tokeniser.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/tokeniser/tokeniser.c b/src/tokeniser/tokeniser.c index 81d02a3..edfa26e 100644 --- a/src/tokeniser/tokeniser.c +++ b/src/tokeniser/tokeniser.c @@ -1870,9 +1870,8 @@ bool hubbub_tokeniser_handle_comment_start(hubbub_tokeniser *tokeniser) pos = hubbub_inputstream_cur_pos(tokeniser->input, &len); - if (tokeniser->context.current_comment.len == 0) - tokeniser->context.current_comment.data.off = pos; - tokeniser->context.current_comment.len += len; + tokeniser->context.current_comment.data.off = pos; + tokeniser->context.current_comment.len = len; hubbub_inputstream_advance(tokeniser->input); @@ -1919,7 +1918,7 @@ bool hubbub_tokeniser_handle_comment_start_dash(hubbub_tokeniser *tokeniser) /* In order to get to this state, the previous character must * be '-'. This means we can safely rewind and add to the - * comment buffer. */ + * comment buffer. */ hubbub_inputstream_rewind(tokeniser->input, 1); @@ -1927,11 +1926,11 @@ bool hubbub_tokeniser_handle_comment_start_dash(hubbub_tokeniser *tokeniser) tokeniser->context.current_comment.data.off = pos; tokeniser->context.current_comment.len += len; - hubbub_inputstream_advance(tokeniser->input); pos = hubbub_inputstream_cur_pos(tokeniser->input, &len); tokeniser->context.current_comment.len += len; + hubbub_inputstream_advance(tokeniser->input); tokeniser->state = HUBBUB_TOKENISER_STATE_COMMENT; } @@ -1964,9 +1963,6 @@ bool hubbub_tokeniser_handle_comment(hubbub_tokeniser *tokeniser) size_t len; pos = hubbub_inputstream_cur_pos(tokeniser->input, &len); - - if (tokeniser->context.current_comment.len == 0) - tokeniser->context.current_comment.data.off = pos; tokeniser->context.current_comment.len += len; hubbub_inputstream_advance(tokeniser->input); |