fget now handles ports better

This commit is contained in:
Izaya 2018-03-07 18:03:23 +11:00
parent 256ffc09ab
commit 25dce8a759
2 changed files with 5 additions and 6 deletions

View File

@ -2,14 +2,12 @@ local net = require "net"
local event = require "event"
local tArgs = {...}
local host, path = tArgs[1], tArgs[2]
local address, path = tArgs[1], tArgs[2]
local port = 70
local sep = host:find(":")
if sep then
port=tonumber(host:sub(sep+1)) or port
host=host:sub(1,sep-1)
end
local host,nport = host:match("(.+):(%d+)")
port = nport or port
host = host or address
local socket = net.open(host,port)
socket:write("t"..path.."\n")

View File

@ -3,6 +3,7 @@
files = {
["master/OpenOS/etc/rc.d/minitel.lua"] = "//etc/rc.d",
["master/OpenOS/usr/lib/net.lua"] = "/lib",
["master/OpenOS/usr/man/minitel/minitel"] = "/usr/man",
},
name = "Minitel",
description = "Simple and powerful networking stack",