diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2020-01-14 21:41:35 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2020-01-14 22:48:08 -0300 |
commit | 6150ac7eccf4c01d06f535b365c946dbf4145f52 (patch) | |
tree | c89f520bd998f48ab402212bab9f6027ed4952c3 /src | |
parent | c28d6390735c5859649052424503cbdeec7e9ec8 (diff) | |
download | luarocks-6150ac7eccf4c01d06f535b365c946dbf4145f52.tar.gz luarocks-6150ac7eccf4c01d06f535b365c946dbf4145f52.tar.bz2 luarocks-6150ac7eccf4c01d06f535b365c946dbf4145f52.zip |
cmd: cleanup slashes
Diffstat (limited to 'src')
-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 |