0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00

[uri] Bare gopher. in go to url dialog "chooses" gopher protocol.

For example gopher.example.net
This commit is contained in:
Witold Filipczyk 2025-05-17 10:23:41 +02:00
parent 5cc976da21
commit 2775006391

View File

@ -1071,6 +1071,11 @@ find_uri_protocol(char *newurl)
/* Contains user/password/ftp-hostname */
return PROTOCOL_FTP;
#ifdef CONFIG_GOPHER
} else if (!c_strncasecmp(newurl, "gopher.", 7)) {
return PROTOCOL_GOPHER;
#endif
#ifdef CONFIG_IPV6
} else if (*newurl == '[' && *ch == ':') {
/* Candidate for IPv6 address */
@ -1168,6 +1173,11 @@ parse_uri:
encode_uri_string(&str, newurl, -1, 0);
break;
case PROTOCOL_GOPHER:
add_to_string(&str, "gopher://");
add_to_string(&str, newurl);
break;
case PROTOCOL_HTTP:
add_to_string(&str, "http://");
add_to_string(&str, newurl);
@ -1290,6 +1300,11 @@ parse_uri:
encode_uri_string(&str, newurl, -1, 0);
break;
case PROTOCOL_GOPHER:
add_to_string(&str, "gopher://");
add_to_string(&str, newurl);
break;
case PROTOCOL_HTTP:
#ifdef CONFIG_SSL
if (get_https_by_default())