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

View File

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