diff options
author | Andrew Sidwell <andy@entai.co.uk> | 2008-08-13 18:45:10 +0000 |
---|---|---|
committer | Andrew Sidwell <andy@entai.co.uk> | 2008-08-13 18:45:10 +0000 |
commit | 44cc5f81feab65753cdf2a0802bea55e96a36721 (patch) | |
tree | dfb3160cf3b2e13f183ad9ea69b1da6e9149196a /src | |
parent | 5ff00221cf02e875088e6087295b71bcad1263b4 (diff) | |
download | libhubbub-44cc5f81feab65753cdf2a0802bea55e96a36721.tar.gz libhubbub-44cc5f81feab65753cdf2a0802bea55e96a36721.tar.bz2 |
Do what r5107 for system ID for public IDs.
svn path=/trunk/hubbub/; revision=5108
Diffstat (limited to 'src')
-rw-r--r-- | src/tokeniser/tokeniser.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/tokeniser/tokeniser.c b/src/tokeniser/tokeniser.c index 9e5b145..ece2e20 100644 --- a/src/tokeniser/tokeniser.c +++ b/src/tokeniser/tokeniser.c @@ -2047,11 +2047,7 @@ hubbub_error hubbub_tokeniser_handle_doctype_public_dq(hubbub_tokeniser *tokenis tokeniser->state = STATE_DATA; return emit_current_doctype(tokeniser, true); } else if (c == '\0') { - if (cdoc->public_id.len == 0) { - START_BUF(cdoc->public_id, u_fffd, sizeof(u_fffd)); - } else { - COLLECT(cdoc->public_id, u_fffd, sizeof(u_fffd)); - } + COLLECT_MS(cdoc->public_id, u_fffd, sizeof(u_fffd)); } else if (c == '\r') { cptr = parserutils_inputstream_peek( tokeniser->input, @@ -2062,7 +2058,7 @@ hubbub_error hubbub_tokeniser_handle_doctype_public_dq(hubbub_tokeniser *tokenis return HUBBUB_OOD; } else if (cptr == PARSERUTILS_INPUTSTREAM_EOF || *((uint8_t *) cptr) != '\n') { - COLLECT(cdoc->public_id, &lf, sizeof(lf)); + COLLECT_MS(cdoc->public_id, &lf, sizeof(lf)); } } else { COLLECT_MS(cdoc->public_id, cptr, len); @@ -2094,13 +2090,7 @@ hubbub_error hubbub_tokeniser_handle_doctype_public_sq(hubbub_tokeniser *tokenis tokeniser->state = STATE_DATA; return emit_current_doctype(tokeniser, true); } else if (c == '\0') { - if (cdoc->public_id.len == 0) { - START_BUF(cdoc->public_id, - u_fffd, sizeof(u_fffd)); - } else { - COLLECT(cdoc->public_id, - u_fffd, sizeof(u_fffd)); - } + COLLECT_MS(cdoc->public_id, u_fffd, sizeof(u_fffd)); } else if (c == '\r') { cptr = parserutils_inputstream_peek( tokeniser->input, @@ -2111,7 +2101,7 @@ hubbub_error hubbub_tokeniser_handle_doctype_public_sq(hubbub_tokeniser *tokenis return HUBBUB_OOD; } else if (cptr == PARSERUTILS_INPUTSTREAM_EOF || *((uint8_t *) cptr) != '\n') { - COLLECT(cdoc->public_id, &lf, sizeof(lf)); + COLLECT_MS(cdoc->public_id, &lf, sizeof(lf)); } } else { COLLECT_MS(cdoc->public_id, cptr, len); |