From 25dce8a759c5d9cf1f206a2ee953e63ff830e8ec Mon Sep 17 00:00:00 2001 From: Izaya Date: Wed, 7 Mar 2018 18:03:23 +1100 Subject: [PATCH] fget now handles ports better --- FRequest/OpenOS/usr/bin/fget.lua | 10 ++++------ programs.cfg | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/FRequest/OpenOS/usr/bin/fget.lua b/FRequest/OpenOS/usr/bin/fget.lua index 3376276..6179552 100644 --- a/FRequest/OpenOS/usr/bin/fget.lua +++ b/FRequest/OpenOS/usr/bin/fget.lua @@ -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") diff --git a/programs.cfg b/programs.cfg index eda381a..087569f 100644 --- a/programs.cfg +++ b/programs.cfg @@ -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",