Skip to content

Commit

Permalink
fix charef parsing
Browse files Browse the repository at this point in the history
fix bugs like this:
&redirect => ®direct
  • Loading branch information
Azq2 authored Jun 16, 2018
1 parent 0ade0e5 commit 541219b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/myhtml/charef.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}


0 comments on commit 541219b

Please sign in to comment.