Testing bug fixes

This commit is contained in:
sloumdrone 2019-01-17 23:20:38 -08:00
parent 649b170291
commit 051feeed61
1 changed files with 5 additions and 7 deletions

12
stubb
View File

@ -106,15 +106,13 @@ function parse_url(u) -- takes URL string
u = 'gopher://'..u
end
local default = {port=70, scheme='gopher'}
local default = {port=70, scheme='gopher', path=''}
local parsed = urlparser.parse(u, default)
if not parsed.path then
parsed.path = '/'
end
if string.find(parsed.path, '^/[%d%a]') then
parsed.gophertype = string.sub(parsed.path, 2, 2)
parsed.path = string.sub(parsed.path, 3) or '/'
elseif string.sub(parsed.path, -1) == '/' then
parsed.path = string.sub(parsed.path, 3)
elseif string.sub(parsed.path, -1) == '/' or parsed.path == '' then
parsed.gophertype = '1'
else
parsed.gophertype = '0'
@ -558,7 +556,7 @@ function open_in_less()
end
if str then
local less = io.popen('less', 'w')
local less = io.popen(os.getenv('PAGER') or'less', 'w')
less:write(str)
less:close()
else