ettercap.lua (ettercap-0.8.3) | : | ettercap.lua (ettercap-0.8.3.1) | ||
---|---|---|---|---|
skipping to change at line 147 | skipping to change at line 147 | |||
elseif file_exists(full_path) == true then | elseif file_exists(full_path) == true then | |||
file_closure = assert(loadfile(full_path)) | file_closure = assert(loadfile(full_path)) | |||
script_path = full_path | script_path = full_path | |||
else | else | |||
log("ERROR: Could not find script '%s'\n", filename) | log("ERROR: Could not find script '%s'\n", filename) | |||
return nil | return nil | |||
end | end | |||
local env = { | local env = { | |||
SCRIPT_PATH = script_path, | SCRIPT_PATH = script_path, | |||
SCRIPT_ARGS = script_params, | ||||
dependencies = {}, | dependencies = {}, | |||
}; | }; | |||
-- No idea what this does. | -- No idea what this does. | |||
setmetatable(env, {__index = _G}); | setmetatable(env, {__index = _G}); | |||
setfenv(file_closure, env); | setfenv(file_closure, env); | |||
local co = coroutine.create(file_closure); -- Create a garbage thread | local co = coroutine.create(file_closure); -- Create a garbage thread | |||
local status, e = coroutine.resume(co); -- Get the globals it loads in env | local status, e = coroutine.resume(co); -- Get the globals it loads in env | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added |