aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-10-31 19:45:47 +0100
committerGitHub <noreply@github.com>2023-10-31 15:45:47 -0300
commit063b2f0fa4fd36e27f1f8f8164539b2c1a4e52a2 (patch)
tree509025f292b4b7b2f3cfcae0787667146877d9d1
parentf911b81053f522c4241b9e5e229a318169ed8c4f (diff)
downloadluarocks-063b2f0fa4fd36e27f1f8f8164539b2c1a4e52a2.tar.gz
luarocks-063b2f0fa4fd36e27f1f8f8164539b2c1a4e52a2.tar.bz2
luarocks-063b2f0fa4fd36e27f1f8f8164539b2c1a4e52a2.zip
Strip quotes for tools in paths on Windows (#1498)
As mentioned by @erw7 in https://github.com/luarocks/luarocks/issues/1443#issuecomment-1483816481, quotes is required when using io.popen but causes problems when using io.iopen. This makes luarocks unable to find its own md5sum.exe it is shipped with. Fixes https://github.com/luarocks/luarocks/issues/1443 Fixes https://github.com/neovim/neovim/issues/22752 Co-authored-by: erw7 <erw7.github@gmail.com>
-rw-r--r--src/luarocks/fs/lua.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index 145a60de..174fdc88 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -126,7 +126,8 @@ function fs_lua.is_tool_available(tool_cmd, tool_name)
126 126
127 -- if it looks like the tool has a pathname, try that first 127 -- if it looks like the tool has a pathname, try that first
128 if tool_cmd_no_args:match("[/\\]") then 128 if tool_cmd_no_args:match("[/\\]") then
129 local fd = io.open(tool_cmd_no_args, "r") 129 local tool_cmd_no_args_normalized = dir.path(tool_cmd_no_args)
130 local fd = io.open(tool_cmd_no_args_normalized, "r")
130 if fd then 131 if fd then
131 fd:close() 132 fd:close()
132 ok = true 133 ok = true