Skip to content

Commit

Permalink
Windows local file path resolve fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akustovbanuba committed Jan 5, 2018
1 parent e884eac commit c0863f4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/url.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,17 @@ namespace Url
}
}

// Windows local file path
if (static_cast<int>(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] == '/')
{
Expand Down Expand Up @@ -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, '/');
}
Expand Down

0 comments on commit c0863f4

Please sign in to comment.