initWithScheme:host:path: update parser to detect Windows ALPHA symbol

This commit is contained in:
Hugo Melder 2022-08-10 17:14:24 +02:00
parent 8e0dc2ace6
commit baf1bb9f73

View file

@ -752,6 +752,19 @@ static NSUInteger urlAlign;
aUrlString = [aUrlString initWithFormat: @"%@://%@%@",
aScheme, aHost, aPath];
}
#if defined(_WIN32)
/* On Windows file systems, an absolute file path can begin with
* a drive letter. The first component in an absolute path
* (e.g. C:) has to be enclosed by a leading slash.
*
* "file:///c:/path/to/file"
*/
else if ([aScheme isEqualToString: @"file"] && [aPath characterAtIndex:1] == ':')
{
aUrlString = [aUrlString initWithFormat: @"%@:///%@%@",
aScheme, aHost, aPath];
}
#endif
else
{
aUrlString = [aUrlString initWithFormat: @"%@://%@/%@",