Skip to content

Commit 3856f1b

Browse files
MineRobber9000un-def
authored andcommitted
Fix incompatibility with Lua 5.5
Under Lua 5.5, the control variable in `for` loops is declared `<const>`, which means attempting to assign to it causes an error. This results in a completely broken environment with an empty PATH. Per the reference manual, the correct fix is to define a local variable inside the loop with the same name as the control variable.
1 parent 3368b98 commit 3856f1b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hererocks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
end
5959
6060
for path_part in (path .. path_sep):gmatch("([^" .. path_sep .. "]*)" .. path_sep) do
61+
local path_part = path_part
6162
if path_part ~= hererocks_path then
6263
if for_fish then
6364
path_part = "'" .. path_part:gsub("'", [['\'']]) .. "'"

0 commit comments

Comments
 (0)