We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e884eac commit 974dcedCopy full SHA for 974dced
src/url.cpp
@@ -266,6 +266,15 @@ namespace Url
266
}
267
268
269
+ // Windows file path
270
+ if ((strncmp(scheme_.c_str(), "file", 4) == 0) &&
271
+ (static_cast<int>(url.length() - position) >= 2
272
+ && url[position] == '/'
273
+ && url[position + 2] == ':'))
274
+ {
275
+ position += 1;
276
+ }
277
+
278
if (position != std::string::npos)
279
{
280
path_.assign(url, position, std::string::npos);
@@ -443,7 +452,8 @@ namespace Url
443
452
444
453
else
445
454
446
- if (!host_.empty() && path_[0] != '/')
455
+ if ((!host_.empty() && path_[0] != '/') ||
456
+ (host_.empty() && path_[0] != '/' && path_[1] == ':'))
447
457
448
458
result.append(1, '/');
449
459
0 commit comments