else if (*p == '\n') {
state = got_lf;
}
- else if (type == DKIM_CANON_RELAXED && *p == ' ') {
+ else if (type == DKIM_CANON_RELAXED && (*p == ' ' || *p == '\t')) {
skip = 0;
state = test_spaces;
}
state = got_lf;
}
}
- else if (type == DKIM_CANON_RELAXED && *(p - 1) == ' ') {
+ else if (type == DKIM_CANON_RELAXED && (*(p - 1) == ' ' ||
+ *(p - 1) == '\t')) {
skip = 1;
state = test_spaces;
}
}
}
else {
- if (type == DKIM_CANON_RELAXED) {
- p -= 1;
+ if (g_ascii_isspace (*(p - 1))) {
+ if (type == DKIM_CANON_RELAXED) {
+ p -= 1;
+ }
}
goto end;
}
p --;
state = got_lf;
}
- else if (type == DKIM_CANON_RELAXED && *(p - 1) == ' ') {
+ else if (type == DKIM_CANON_RELAXED && (*(p - 1) == ' ' ||
+ *(p - 1) == '\t')) {
skip = 1;
state = test_spaces;
}
}
}
else {
- if (type == DKIM_CANON_RELAXED) {
- p -= 1;
+ if (g_ascii_isspace (*(p - 1))) {
+ if (type == DKIM_CANON_RELAXED) {
+ p -= 1;
+ }
}
goto end;
}
p -= 2;
state = got_lf;
}
- else if (type == DKIM_CANON_RELAXED && *(p - 3) == ' ') {
+ else if (type == DKIM_CANON_RELAXED && (*(p - 3) == ' ' ||
+ *(p - 3) == '\t')) {
skip = 2;
state = test_spaces;
}
}
}
else {
- if (type == DKIM_CANON_RELAXED) {
- p -= 2;
+ if (g_ascii_isspace (*(p - 2))) {
+ if (type == DKIM_CANON_RELAXED) {
+ p -= 2;
+ }
}
goto end;
}
case test_spaces:
t = p - skip;
- while (t > start + 2 && *t == ' ') {
+ while (t > start + 2 && (*t == ' ' || *t == '\t')) {
t --;
}