update
This commit is contained in:
@@ -7,10 +7,10 @@ local disks=EFI.disks
|
||||
local arch=EFI.architecture
|
||||
local kernel = {}
|
||||
kernel.LOG_Text=""
|
||||
kernel.version="HyperionOS V1.2.4-dev_5"
|
||||
kernel.tag="1.2.4-dev_5"
|
||||
kernel.version="HyperionOS V1.2.4"
|
||||
kernel.tag="1.2.4"
|
||||
kernel.process = "Kernel"
|
||||
kernel.users={[0]="root",[1]="User"}
|
||||
kernel.users={[0]="root",[1000]="User"}
|
||||
kernel.hostname = "hyperion"
|
||||
kernel.groups = {}
|
||||
kernel.uid = 0
|
||||
|
||||
@@ -23,6 +23,7 @@ function string.split(str, delim, maxResultCountOrNil)
|
||||
assert(#delim == 1, "only delim len 1 supported for now")
|
||||
if not str then return false end
|
||||
maxResultCountOrNil = (maxResultCountOrNil or 0) - 1
|
||||
if str == "" then return {} end
|
||||
local rv = {}
|
||||
local buf = ""
|
||||
for i = 1, #str do
|
||||
|
||||
@@ -124,7 +124,7 @@ end
|
||||
|
||||
local function validateComponent(comp)
|
||||
local lower = comp:lower()
|
||||
if not lower:match(SAFE_COMPONENT_PATTERN) then
|
||||
if not comp:match(SAFE_COMPONENT_PATTERN) then
|
||||
error("EINVAL: illegal characters in path component: " .. comp, 3)
|
||||
end
|
||||
if lower == ".meta" then
|
||||
@@ -276,7 +276,7 @@ local function namei(path, noFollow, symDepth)
|
||||
|
||||
else
|
||||
validateComponent(comp)
|
||||
local lname = comp:lower()
|
||||
local lname = comp
|
||||
|
||||
local curPath = "/" .. table.concat(stack, "/")
|
||||
|
||||
@@ -374,7 +374,7 @@ local function normalizePath(path)
|
||||
table.remove(stack)
|
||||
end
|
||||
else
|
||||
table.insert(stack, comp:lower())
|
||||
table.insert(stack, comp)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -184,11 +184,16 @@ function socket.sockshutdown(fd)
|
||||
return true
|
||||
end
|
||||
|
||||
function socket.socketendpoints()
|
||||
return table.keys(socket.handlers)
|
||||
end
|
||||
|
||||
sys.socket = socket.socket
|
||||
sys.connect = socket.connect
|
||||
sys.listen = socket.listen
|
||||
sys.send = socket.send
|
||||
sys.recv = socket.recv
|
||||
sys.sockshutdown = socket.sockshutdown
|
||||
sys.socketendpoints = socket.socketendpoints
|
||||
|
||||
kernel.log("Loaded socket module")
|
||||
@@ -19,4 +19,25 @@ function printInline(...)
|
||||
for i = 1, #args do output = output .. tostring(args[i]) .. "\t" end
|
||||
output = output:sub(1, -2)
|
||||
syscall.write(1, output)
|
||||
end
|
||||
|
||||
function userinput(fd, helpstr, replacestr, fdo)
|
||||
local str = ""
|
||||
if helpstr then print(helpstr) end
|
||||
while true do
|
||||
local inp = syscall.read(fd)
|
||||
if inp~="" and inp~=nil then
|
||||
if inp~="\n" then
|
||||
if replacestr then
|
||||
syscall.write(fdo, replacestr)
|
||||
else
|
||||
syscall.write(fdo, inp)
|
||||
end
|
||||
str = inp
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
return str
|
||||
end
|
||||
Reference in New Issue
Block a user