diff options
-rw-r--r-- | src/luarocks/cmd.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 7866cd3c..813f01ab 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -176,13 +176,14 @@ local function search_lua_in_path(lua_version, verbose) | |||
176 | local path_sep = (package.config:sub(1, 1) == "\\" and ";" or ":") | 176 | local path_sep = (package.config:sub(1, 1) == "\\" and ";" or ":") |
177 | local all_tried = {} | 177 | local all_tried = {} |
178 | for bindir in os.getenv("PATH"):gmatch("[^"..path_sep.."]+") do | 178 | for bindir in os.getenv("PATH"):gmatch("[^"..path_sep.."]+") do |
179 | local parentdir = bindir:gsub("[\\/][^\\/]+[\\/]?$", "") | 179 | local parentdir = dir.path((bindir:gsub("[\\/][^\\/]+[\\/]?$", ""))) |
180 | local detected, tried = util.find_lua(dir.path(parentdir), lua_version) | 180 | local detected, tried = util.find_lua(parentdir, lua_version) |
181 | if detected then | 181 | if detected then |
182 | return detected | 182 | return detected |
183 | else | 183 | else |
184 | table.insert(all_tried, tried) | 184 | table.insert(all_tried, tried) |
185 | end | 185 | end |
186 | bindir = dir.path(bindir) | ||
186 | detected = util.find_lua(bindir, lua_version) | 187 | detected = util.find_lua(bindir, lua_version) |
187 | if detected then | 188 | if detected then |
188 | return detected | 189 | return detected |