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

Only call fs::path_abs with existing files #506

Merged
merged 2 commits into from
Dec 5, 2021

Conversation

renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Dec 4, 2021

Due to r-lib/fs#269, the known limitation of fs functions, it might make sense to only call fs::path_abs only with existing files so that long strings that are not file paths are not passed to the function. In #502, it seems that even as we filter the string length, it might be possible that some long strings will still cause a problem. This PR checks the strings first and only call fs::path_abs() with existing file paths.

Here, the purpose we use fs::path_abs() is that we need to get an absolute path but not follow the symlinks.

@renkun-ken renkun-ken merged commit 7f53bf7 into REditorSupport:master Dec 5, 2021
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.

None yet

2 participants