1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:17:45 +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:
Julian Offenhäuser 2023-03-21 19:57:47 +01:00 committed by Andreas Kling
parent 93062e2b78
commit fca9da4191

View file

@ -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()