Skip to content

Commit

Permalink
Library - Use Case sensitive option when listing filtering is done by…
Browse files Browse the repository at this point in the history
… the library

0e207a0 wrongly removed the DokanIsNameInExpression caseSensitive usage.
When the library does the filtering, it should take into account the type of filesystem case type used.
  • Loading branch information
Liryna committed Jun 13, 2022
1 parent e02f1ad commit 47ad17a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dokan/directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ LONG MatchFiles(PDOKAN_IO_EVENT IoEvent, PDOKAN_VECTOR DirList) {
BOOL patternCheck = FALSE;
PWCHAR pattern = NULL;
BOOL bufferOverFlow = FALSE;
BOOL caseSensitive = IoEvent->DokanInstance->DokanOptions->Options &
DOKAN_OPTION_CASE_SENSITIVE;

if (IoEvent->EventContext->Operation.Directory.SearchPatternLength > 0) {
pattern = (PWCHAR)((SIZE_T)&IoEvent->EventContext->Operation.Directory
Expand All @@ -412,7 +414,8 @@ LONG MatchFiles(PDOKAN_IO_EVENT IoEvent, PDOKAN_VECTOR DirList) {

// pattern is not specified or pattern match is ignore cases
if (!patternCheck ||
DokanIsNameInExpression(pattern, find->FindData.cFileName, TRUE)) {
DokanIsNameInExpression(pattern, find->FindData.cFileName,
!caseSensitive)) {
if (IoEvent->EventContext->Operation.Directory.FileIndex <= index) {
// index+1 is very important, should use next entry index
ULONG entrySize = DokanFillDirectoryInformation(
Expand Down

0 comments on commit 47ad17a

Please sign in to comment.