diff --git a/src/url.cpp b/src/url.cpp index 1f54327..5ed6207 100644 --- a/src/url.cpp +++ b/src/url.cpp @@ -199,8 +199,17 @@ namespace Url } } + // Windows local file path + if (static_cast(url.length() - position) >= 4 + && url[position] == '/' + && url[position + 1] == '/' + && url[position + 2] == '/' + && url[position + 4] == ':') + { + position += 3; + } // Search for the netloc - if ((url.length() - position) >= 1 + else if ((url.length() - position) >= 1 && url[position] == '/' && url[position + 1] == '/') { @@ -443,7 +452,8 @@ namespace Url } else { - if (!host_.empty() && path_[0] != '/') + if ((!host_.empty() && path_[0] != '/') || + (host_.empty() && path_[0] != '/' && path_[2] == ':')) { result.append(1, '/'); }