summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-29 22:49:37 +0800
committerruki <[email protected]>2026-03-29 22:49:41 +0800
commit1bccfc273af2b1d579d033324bca481e15c58653 (patch)
tree192697793bd61d48b4423da0ac4a1eab804d80dc /xmake/core/base/os.lua
parentf4513cc28aa778e1ad0d050511cc7e295fe81e32 (diff)
fix const limit on lua5.5
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 9ba469505..3ef59775c 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -437,6 +437,7 @@ function os.match(pattern, mode, opt)
if excludes then
local _excludes = {}
for _, exclude in ipairs(excludes) do
+ local exclude = exclude
exclude = path.translate(exclude)
exclude = path.pattern(exclude)
table.insert(_excludes, exclude)
@@ -988,9 +989,9 @@ function os.execv(program, argv, opt)
filename = os._get_shell_path(opt) or "sh"
argv = table.join(shellfile, argv)
else
- line = line:sub(3)
+ local shebang = line:sub(3)
local shellargv = {}
- local splitinfo = line:split("%s")
+ local splitinfo = shebang:split("%s")
filename = splitinfo[1]
if #splitinfo > 1 then
shellargv = table.slice(splitinfo, 2)
@@ -1013,6 +1014,7 @@ function os.execv(program, argv, opt)
local envars = os.getenvs()
if setenvs then
for k, v in pairs(setenvs) do
+ local v = v
if type(v) == "table" then
v = path.joinenv(v)
end
@@ -1021,6 +1023,7 @@ function os.execv(program, argv, opt)
end
if addenvs then
for k, v in pairs(addenvs) do
+ local v = v
if type(v) == "table" then
v = path.joinenv(v)
end
@@ -1033,6 +1036,7 @@ function os.execv(program, argv, opt)
end
envs = {}
for k, v in pairs(envars) do
+ local v = v
-- we try to fix too long value before running process
if type(v) == "string" and #v > 4096 and os.host() == "windows" then
v = os._deduplicate_pathenv(v)