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

find_files_with_pattern must be implemented #6

Open
inetic opened this issue May 10, 2023 · 1 comment
Open

find_files_with_pattern must be implemented #6

inetic opened this issue May 10, 2023 · 1 comment

Comments

@inetic
Copy link
Contributor

inetic commented May 10, 2023

It's my understanding that in C the function pointer to find_files_with_pattern may be left unset. However the rust wrapper implements its default implementation here.

Problem is this: The C code uses find_files here to get the content of the directory. Then it gets here, then here, then here and finally ends up in MatchFiles.

In MatchFiles it checks whether FindFilesWithPattern is set, which it is and thus patternCheck is NOT set to TRUE.

Because of that this condition always passes on the first entry that find_files returns.

This bug can be reproduced with your memfs example:

  1. mount the fs
  2. create some number of files in it: f1.txt, f2.txt, f3.txt, f4.txt
  3. select one of the files, say f3.txt
  4. press the Del button
  5. a dialog appears asking whether you want to delete a file. This file will likely not be f3.txt (if it is, try with another file)
@inetic
Copy link
Contributor Author

inetic commented May 11, 2023

After some thinking, this would probably be best to fix in the C code. I reported the issue here. If you agree than feel free to close this one.

Additionally, I worked around the issue by implementing find_files_with_pattern with the help of the is_name_in_expression support function.

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

No branches or pull requests

1 participant