Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Invalid directory name generated by installation script #117

Closed
haruleekim opened this issue Jan 20, 2024 · 1 comment · Fixed by #118
Closed

[Bug] Invalid directory name generated by installation script #117

haruleekim opened this issue Jan 20, 2024 · 1 comment · Fixed by #118

Comments

@haruleekim
Copy link

haruleekim commented Jan 20, 2024

local tempdir = vim.fs.joinpath(vim.fn.stdpath("run"), "luarocks-" .. vim.loop.random(7))

The code vim.loop.random(7) in the above possibly generates a directory name that is treated as invalid by the OS.
For example: luarocks-<a1><ec>^O<98>^^{<f8>.

Therefore, I suggest changing that line to the following:

local tempdir = vim.fs.joinpath(vim.fn.stdpath("run"), string.format("luarocks-%X", math.random(256 ^ 7)))
@mrcjkb
Copy link
Member

mrcjkb commented Jan 20, 2024

Hey 👋
Thanks for reporting!

Your proposed solution looks reasonable to me. @vhyrro what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants