Commit 7108cd7b98dc621bb64b3a09dbf38fdca4c71f55
1 parent
10fda01b
Remove redundant tests in QPDFTokenizer::readToken
Showing
1 changed file
with
5 additions
and
6 deletions
libqpdf/QPDFTokenizer.cc
| ... | ... | @@ -989,15 +989,14 @@ QPDFTokenizer::readToken( |
| 989 | 989 | this->error_message = "unexpected EOF"; |
| 990 | 990 | offset = input->getLastOffset(); |
| 991 | 991 | } |
| 992 | - if (this->state != st_token_ready) { | |
| 993 | - throw std::logic_error( | |
| 994 | - "getToken returned false after presenting EOF"); | |
| 995 | - } | |
| 996 | 992 | } else { |
| 997 | - presentCharacter(ch); | |
| 998 | - if (this->before_token && (input->getLastOffset() == offset)) { | |
| 993 | + handleCharacter(ch); | |
| 994 | + if (this->before_token) { | |
| 999 | 995 | ++offset; |
| 1000 | 996 | } |
| 997 | + if (this->in_token) { | |
| 998 | + this->raw_val += ch; | |
| 999 | + } | |
| 1001 | 1000 | if (max_len && (this->raw_val.length() >= max_len) && |
| 1002 | 1001 | (this->state != st_token_ready)) { |
| 1003 | 1002 | // terminate this token now | ... | ... |