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 crash on inaccessible directory #14

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Fix crash on inaccessible directory #14

merged 1 commit into from
Dec 20, 2021

Conversation

michaeladler
Copy link
Contributor

qmarkdown crashes if a directory with inaccessible permissions (e.g. owner root, mode 0700) is encountered while scanning the
workspace. The crash is caused by an exception which is thrown by the fs::directory_iterator.

This is similar to the fix I have done here, but unfortunately a little less pretty in the case of auto_complete where we don't need any recursion: the legacy API std::experimental::filesystem::directory_iterator::directory_iterator does not provide the option to set directory_options in the second argument, so I had to switch to the recursive version and bail out on depth > 0. In the case of resgen.cpp it removes the need for manual recursion.

qmarkdown crashes if a directory with inaccessible permissions (e.g.
owner root, mode 0700) is encountered while scanning the
workspace. The crash is caused by an exception which is thrown by the
fs::directory_iterator.
@Peterwmoss Peterwmoss added the bug Something isn't working label Dec 19, 2021
@Peterwmoss Peterwmoss self-assigned this Dec 19, 2021
@Peterwmoss Peterwmoss self-requested a review December 19, 2021 21:25
@Peterwmoss
Copy link
Owner

Peterwmoss commented Dec 19, 2021

Thanks for taking a look at this - the auto complete is still very much WIP, but I don't have a lot of free time to work on this project at the moment.

I'll take a look at it in the morning when I wake up as I now have somewhat of a vacation, but initial look tells me that it's good 😄

@Peterwmoss
Copy link
Owner

Looks good - thanks for your contribution! I'll merge when checks pass.

@Peterwmoss Peterwmoss merged commit 979da49 into Peterwmoss:master Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants