st = parse_port;
c = p + 1;
}
- else if (*p == '/') {
+ else if (*p == '/' || *p == '\\') {
st = parse_path;
c = p + 1;
}
/* Too large domain */
goto out;
}
- if (t == '/' || t == ':' || t == '?' || t == '#') {
+ if (t == '/' || t == '\\' || t == ':' || t == '?' || t == '#') {
if (p - c == 0) {
goto out;
}
- if (t == '/') {
+ if (t == '/' || t == '\\') {
SET_U (u, UF_HOST);
st = parse_suffix_slash;
}
}
break;
case parse_port:
- if (t == '/') {
+ if (t == '/' || t == '\\') {
pt = strtoul (c, NULL, 10);
if (pt == 0 || pt > 65535) {
goto out;
p++;
break;
case parse_suffix_slash:
- if (t != '/') {
+ if (t != '/' && t != '\\') {
c = p;
st = parse_path;
}
}},
{"http://@@example.com", true, {
user = "@", host = "example.com"
- }}
+ }},
+ {"https://example.com\\_Resources\\ClientImages\\UserData?ol\\o#ololo\\", true, {
+ host = "example.com", path = "_Resources/ClientImages/UserData",
+ query = "ol\\o", fragment = "ololo\\",
+ }},
}
-- Some cases from https://code.google.com/p/google-url/source/browse/trunk/src/url_canon_unittest.cc