mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibPDF: Don't consume anything other than EOL in Reader::consume_eol()
This was previously a slightly confusing API. Even when there was no EOL marker at the current location, we would still consume one byte. It will now consume either EOL or nothing at all.
This commit is contained in:
parent
93062e2b78
commit
fca9da4191
1 changed files with 5 additions and 2 deletions
|
@ -46,8 +46,11 @@ bool Reader::consume_eol()
|
|||
consume(2);
|
||||
return true;
|
||||
}
|
||||
auto consumed = consume();
|
||||
return consumed == 0xd || consumed == 0xa;
|
||||
if (matches_eol()) {
|
||||
consume();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Reader::consume_whitespace()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue