mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 11:02:44 +00:00
If the URL did not specify a scheme, try to guess it from the host name.
This commit is contained in:
parent
1ba8497660
commit
64638f67a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69976
@ -197,6 +197,16 @@ fetch(char *URL, char *path)
|
||||
goto failure;
|
||||
}
|
||||
|
||||
/* if no scheme was specified, take a guess */
|
||||
if (!*url->scheme) {
|
||||
if (!*url->host)
|
||||
strcpy(url->scheme, SCHEME_FILE);
|
||||
else if (strncasecmp(url->host, "ftp.", 4))
|
||||
strcpy(url->scheme, SCHEME_FTP);
|
||||
else if (strncasecmp(url->host, "www.", 4))
|
||||
strcpy(url->scheme, SCHEME_HTTP);
|
||||
}
|
||||
|
||||
timeout = 0;
|
||||
*flags = 0;
|
||||
count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user