aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-08-18 19:43:50 +0200
committerm-holger <m-holger@kubitscheck.org>2022-08-21 03:46:31 +0200
commit2697ba49bce8113c29eab4367d14936ccb2f500e (patch)
treec619cd73a62a92034bf2f0d37f0cd0cb7b7958eb
parentf9530a581522a418b8298791969ac8a0e002dfff (diff)
downloadqpdf-2697ba49bce8113c29eab4367d14936ccb2f500e.tar.zst
Add private method QPDFTokenizer::inHexstring
-rw-r--r--include/qpdf/QPDFTokenizer.hh3
-rw-r--r--libqpdf/QPDFTokenizer.cc10
2 files changed, 10 insertions, 3 deletions
diff --git a/include/qpdf/QPDFTokenizer.hh b/include/qpdf/QPDFTokenizer.hh
index b04e4d89..a0e18248 100644
--- a/include/qpdf/QPDFTokenizer.hh
+++ b/include/qpdf/QPDFTokenizer.hh
@@ -197,7 +197,6 @@ class QPDFTokenizer
bool isSpace(char);
bool isDelimiter(char);
void findEI(std::shared_ptr<InputSource> input);
- void handleCharacter(char);
enum state_e {
st_top,
@@ -212,6 +211,8 @@ class QPDFTokenizer
st_token_ready
};
+ void handleCharacter(char);
+ void inHexstring(char);
void reset();
// Lexer state
diff --git a/libqpdf/QPDFTokenizer.cc b/libqpdf/QPDFTokenizer.cc
index 6c83119f..1220e016 100644
--- a/libqpdf/QPDFTokenizer.cc
+++ b/libqpdf/QPDFTokenizer.cc
@@ -331,7 +331,8 @@ QPDFTokenizer::handleCharacter(char ch)
return;
}
this->state = st_in_hexstring;
- break;
+ inHexstring(ch);
+ return;
case st_gt:
if (ch == '>') {
@@ -469,13 +470,18 @@ QPDFTokenizer::handleCharacter(char ch)
return;
case (st_in_hexstring):
- break;
+ inHexstring(ch);
+ return;
default:
throw std::logic_error(
"INTERNAL ERROR: invalid state while reading token");
}
+}
+void
+QPDFTokenizer::inHexstring(char ch)
+{
if (ch == '>') {
this->type = tt_string;
this->state = st_token_ready;