mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
fixed os.setenv
This commit is contained in:
parent
0d83803e2c
commit
65a1c58bcf
@ -37,13 +37,16 @@ end
|
||||
|
||||
function os.setenv(varname, value)
|
||||
checkArg(1, varname, "string", "number")
|
||||
if value == nil then env[varname] = nil
|
||||
local success, val = pcall(tostring, value)
|
||||
if success then
|
||||
env[varname] = val
|
||||
return env[varname]
|
||||
if value == nil then
|
||||
env[varname] = nil
|
||||
else
|
||||
return nil, val
|
||||
local success, val = pcall(tostring, value)
|
||||
if success then
|
||||
env[varname] = val
|
||||
return env[varname]
|
||||
else
|
||||
return nil, val
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user