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:
- mount the fs
- create some number of files in it: f1.txt, f2.txt, f3.txt, f4.txt
- select one of the files, say f3.txt
- press the Del button
- 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)
It's my understanding that in C the function pointer to
find_files_with_patternmay be left unset. However the rust wrapper implements its default implementation here.Problem is this: The C code uses
find_fileshere to get the content of the directory. Then it gets here, then here, then here and finally ends up inMatchFiles.In
MatchFilesit checks whetherFindFilesWithPatternis set, which it is and thuspatternCheckis NOT set toTRUE.Because of that this condition always passes on the first entry that
find_filesreturns.This bug can be reproduced with your memfs example: