Fix octal escapes

This commit is contained in:
Přemysl Eric Janouch 2018-10-02 23:17:15 +02:00
parent 2d3fd3317b
commit 160f09ecc3
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 5 additions and 6 deletions

View File

@ -136,12 +136,11 @@ struct pdf_lexer {
if (eat_newline(ch)) if (eat_newline(ch))
continue; continue;
std::string octal; std::string octal;
if (ch && strchr(oct_alphabet, ch)) {
octal += ch;
if (*p && strchr(oct_alphabet, *p)) octal += *p++; if (*p && strchr(oct_alphabet, *p)) octal += *p++;
if (*p && strchr(oct_alphabet, *p)) octal += *p++; if (*p && strchr(oct_alphabet, *p)) octal += *p++;
if (*p && strchr(oct_alphabet, *p)) octal += *p++; ch = std::stoi(octal, nullptr, 8);
if (!octal.empty()) {
value += char(std::stoi(octal, nullptr, 8));
continue;
} }
} }
} }