diff options
author | Кирилл Жумарин <azq2@ya.ru> | 2018-06-16 14:37:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-16 14:37:28 +0300 |
commit | 0feee0101d7f65db6bd1db1a26dd50e241652111 (patch) | |
tree | 0de2422f0072374d6887a4eda5bc66bfe469ff43 | |
parent | 7a710b8849d3fad8aad57b0dec39f21b14eda6b0 (diff) |
fix charef parsing
fix bugs like this:
&redirect => ®direct
-rw-r--r-- | source/myhtml/charef.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/myhtml/charef.c b/source/myhtml/charef.c index 1930f0c..64975de 100644 --- a/source/myhtml/charef.c +++ b/source/myhtml/charef.c @@ -140,14 +140,12 @@ const charef_entry_t * myhtml_charef_find_by_pos(size_t pos, const char *begin, result->is_done = 1; - if(named_character_references[pos].codepoints_len) - return &named_character_references[pos]; - else if(result->last_entry) { + if(result->last_entry) { *offset = result->last_offset; return result->last_entry; } - return &named_character_references[pos]; + return &named_character_references[0]; } |