a bit more improved telnet urls

This commit is contained in:
Luxferre
2023-03-30 09:32:46 +03:00
parent c5171f5922
commit 7f442ca7e6
+5 -2
View File
@@ -106,8 +106,11 @@ gmparse() { # args: line, curhost, curport
[[ '3' == "$rtype" ]] && desc="$ERRCOLOR$desc$ERESET" # wrap error messages in the coloration terminal commands
# handle external URLs as information lines of a special kind
[[ 'h' == "$rtype" ]] && desc="$desc: ${sel#URL:}"
# handle 8-type resources as telnet:// URIs
[[ '8' == "$rtype" ]] && desc="$desc: telnet://${sel}@${rhost}:${rport}/"
if [[ '8' == "$rtype" ]]; then # handle 8-type resources as telnet:// URIs
local username="${sel}@"
[[ -z "${sel}" ]] && username=''
desc="$desc: telnet://${username}${rhost}:${rport}/"
fi
fi
[[ '0' == "$rtype" ]] && action='P' # plain text is plain text
[[ '1' == "$rtype" ]] && action='M' # it's a Gophermap