Skip to content

Only call fs::path_abs with existing files#506

Merged
renkun-ken merged 2 commits intoREditorSupport:masterfrom
renkun-ken:fs-path-abs
Dec 5, 2021
Merged

Only call fs::path_abs with existing files#506
renkun-ken merged 2 commits intoREditorSupport:masterfrom
renkun-ken:fs-path-abs

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.

2 participants