parse_slash,
parse_slash_slash,
parse_semicolon,
+ parse_prefix_question,
+ parse_destination,
+ parse_equal,
parse_user,
parse_at,
- parse_domain
+ parse_domain,
+ parse_suffix_question,
+ parse_query
} st = parse_mailto;
while (*p) {
case parse_semicolon:
if (t == '/') {
st = parse_slash;
+ p ++;
}
else {
- st = parse_user;
- c = p;
+ st = parse_slash_slash;
}
- p ++;
break;
case parse_slash:
if (t == '/') {
p ++;
break;
case parse_slash_slash:
+ if (t == '?') {
+ st = parse_prefix_question;
+ p ++;
+ }
+ else {
+ c = p;
+ st = parse_user;
+ }
+ break;
+ case parse_prefix_question:
+ if (t == 't') {
+ /* XXX: accept only to= */
+ st = parse_destination;
+ }
+ else {
+ return 1;
+ }
+ break;
+ case parse_destination:
+ if (t == '=') {
+ st = parse_equal;
+ }
+ p ++;
+ break;
+ case parse_equal:
c = p;
st = parse_user;
break;
st = parse_domain;
break;
case parse_domain:
- if (!is_domain (t) && t != '.' && t != '_') {
+ if (t == '?') {
+ u->field_set |= 1 << UF_HOST;
+ u->field_data[UF_HOST].len = p - c;
+ u->field_data[UF_HOST].off = c - str;
+
+ st = parse_suffix_question;
+ }
+ else if (!is_domain (t) && t != '.' && t != '_') {
+ return 1;
+ }
+ p ++;
+ break;
+ case parse_suffix_question:
+ c = p;
+ st = parse_query;
+ break;
+ case parse_query:
+ if (!is_atom (t)) {
return 1;
}
p ++;