aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/persist.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua
index 87db96b2..39e1e71c 100644
--- a/src/luarocks/persist.lua
+++ b/src/luarocks/persist.lua
@@ -14,8 +14,12 @@ local function run_file(filename, env)
14 if not fd then 14 if not fd then
15 return nil, err, "open" 15 return nil, err, "open"
16 end 16 end
17 local str = fd:read("*a"):gsub("^#![^\n]*\n", "") 17 local str, err = fd:read("*a")
18 fd:close() 18 fd:close()
19 if not str then
20 return nil, err, "open"
21 end
22 str = str:gsub("^#![^\n]*\n", "")
19 local chunk, ran 23 local chunk, ran
20 if _VERSION == "Lua 5.1" then -- Lua 5.1 24 if _VERSION == "Lua 5.1" then -- Lua 5.1
21 chunk, err = loadstring(str, filename) 25 chunk, err = loadstring(str, filename)