|
@@ -547,7 +547,7 @@ bool parseLong(T& res, F f, const std::string& s, int base)
|
|
|
return false;
|
|
|
}
|
|
|
if (*endptr != '\0') {
|
|
|
- for (const char* i = endptr, * eoi = s.c_str() + s.size(); i < eoi; ++i) {
|
|
|
+ for (const char *i = endptr, *eoi = s.c_str() + s.size(); i < eoi; ++i) {
|
|
|
if (!isspace(*i)) {
|
|
|
return false;
|
|
|
}
|
|
@@ -750,7 +750,7 @@ void parsePrioritizePieceRange(
|
|
|
std::string iso8859p1ToUtf8(const char* src, size_t len)
|
|
|
{
|
|
|
std::string dest;
|
|
|
- for (const char* p = src, * last = src + len; p != last; ++p) {
|
|
|
+ for (const char *p = src, *last = src + len; p != last; ++p) {
|
|
|
unsigned char c = *p;
|
|
|
if (0xa0u <= c) {
|
|
|
if (c <= 0xbfu) {
|
|
@@ -810,31 +810,28 @@ static const uint8_t utf8d[] = {
|
|
|
* The first part of the table maps bytes to character classes that
|
|
|
* to reduce the size of the transition table and create bitmasks.
|
|
|
*/
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
|
|
|
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9,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8, 8, 2, 2, 2, 2, 2, 2,
|
|
|
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10,
|
|
|
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 11, 6, 6, 6, 5, 8, 8, 8, 8, 8,
|
|
|
+ 8, 8, 8, 8, 8, 8,
|
|
|
|
|
|
/*
|
|
|
* The second part is a transition table that maps a combination
|
|
|
* of a state of the automaton and a character class to a state.
|
|
|
*/
|
|
|
- 0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12, 12, 12, 12, 12, 12,
|
|
|
- 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12, 12, 24,
|
|
|
- 12, 12, 12, 12, 12, 24, 12, 24, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 12,
|
|
|
- 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12,
|
|
|
- 12, 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12,
|
|
|
- 12, 12, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
|
|
+ 0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12, 12, 12, 12, 12, 12,
|
|
|
+ 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12, 12, 24, 12,
|
|
|
+ 12, 12, 12, 12, 24, 12, 24, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12,
|
|
|
+ 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12,
|
|
|
+ 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12,
|
|
|
+ 12, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
|
|
};
|
|
|
|
|
|
static uint32_t utf8dfa(uint32_t* state, uint32_t* codep, uint32_t byte)
|
|
@@ -884,8 +881,8 @@ ssize_t parse_content_disposition(char* dest, size_t destlen,
|
|
|
const char** charsetp, size_t* charsetlenp,
|
|
|
const char* in, size_t len)
|
|
|
{
|
|
|
- const char* p = in, * eop = in + len, * mark_first = nullptr,
|
|
|
- * mark_last = nullptr;
|
|
|
+ const char *p = in, *eop = in + len, *mark_first = nullptr,
|
|
|
+ *mark_last = nullptr;
|
|
|
int state = CD_BEFORE_DISPOSITION_TYPE;
|
|
|
int in_file_parm = 0;
|
|
|
int flags = 0;
|