Skip to content

Commit

Permalink
LibPDF: Don't consume anything other than EOL in Reader::consume_eol()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
janso3 authored and awesomekling committed Mar 22, 2023
1 parent 93062e2 commit fca9da4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Userland/Libraries/LibPDF/Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fca9da4

Please sign in to comment.