summaryrefslogtreecommitdiff
path: root/src/main_windows.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-03 21:14:08 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-03 21:14:08 +0100
commit26bb40b2f9cf10eb8aaf4f6ac53585ef73be5134 (patch)
tree42766231bc5c69c347ebd239c9451b08128ec0ba /src/main_windows.cpp
parent16d695eee026947899f2168905bae39f4e3c5895 (diff)
implement file filtering
Diffstat (limited to 'src/main_windows.cpp')
-rw-r--r--src/main_windows.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main_windows.cpp b/src/main_windows.cpp
index d985416..cbc7265 100644
--- a/src/main_windows.cpp
+++ b/src/main_windows.cpp
@@ -312,6 +312,14 @@ void ts_platform_list_files_block(ts_search_result* result, wchar_t* start_dir)
(file_info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ||
(file_info.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE))
{
+ char *matched_filter = 0;
+ utf8_int8_t uni_name[MAX_INPUT_LENGTH];
+ WideCharToMultiByte(CP_UTF8,0,name,-1,(LPSTR)uni_name,MAX_INPUT_LENGTH, NULL, NULL);
+ if (ts_filter_matches(&result->filters, uni_name, &matched_filter) == -1) {
+ continue;
+ }
+ (void)matched_filter;
+
wchar_t complete_file_path[MAX_INPUT_LENGTH];
wcscpy(complete_file_path, search_dir);
wcscat(complete_file_path, L"\\");