Skip to content

Commit

Permalink
setenv/unsetenv
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Sep 4, 2024
1 parent 0392b59 commit 904d5f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/details/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ end
-- @param value the value to set
-- @return true on success, false otherwise
local function setenv(env, value)
assert(type(env) == "string", "env must be a string")
assert(type(value) == "string", "value must be a string")
return ffi.C.setenv(env, value, 1) == 0
end

Expand All @@ -129,6 +131,7 @@ end
-- @param env (string) name of the environment variable
-- @return true on success, false otherwise
local function unsetenv(env)
assert(type(env) == "string", "env must be a string")
return ffi.C.unsetenv(env) == 0
end

Expand Down

0 comments on commit 904d5f5

Please sign in to comment.