summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/base/compat/env.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/xmake/core/base/compat/env.lua b/xmake/core/base/compat/env.lua
index ec21c271b..2e9150cf5 100644
--- a/xmake/core/base/compat/env.lua
+++ b/xmake/core/base/compat/env.lua
@@ -80,8 +80,7 @@ else -- >= Lua 5.2
-- 5.1 style `getfenv` implemented in 5.2
function env.getfenv(f)
if f == 0 then return _G end -- simulated behavior
- f = f or 1
- local f = envhelper(f, 'getfenv')
+ local f = envhelper(f or 1, 'getfenv')
local up, val = envlookup(f)
if not up then return _G end -- simulated behavior [**]
return val