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

Fix regular expression to find root directory in make/bootstrap.lua #943

Merged
merged 1 commit into from
Feb 8, 2022
Merged

Fix regular expression to find root directory in make/bootstrap.lua #943

merged 1 commit into from
Feb 8, 2022

Conversation

st9007a
Copy link
Contributor

@st9007a st9007a commented Feb 3, 2022

If there is a posix path like /a/b//c, the regex pattern to find root directory won't match anything and cause server crashing even if the path is valid. I think windows path also has this problem.

This will happen if someone add an environment path end with a separator.

export PATH="$PATH:/path/to/lua-language-server/bin/"

This environment path will be used to extend to package.cpath. So, package.cpath here is /path/to/lua-language-server/bin//?.so which the current regex pattern can't recognize.

@sumneko
Copy link
Collaborator

sumneko commented Feb 8, 2022

Thank you!

@sumneko sumneko merged commit 9bce8c2 into LuaLS:master Feb 8, 2022
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 this pull request may close these issues.

2 participants