From c047b116d71060f1c292e63b8bc413e0f22b07e0 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 10 Jan 2022 08:42:50 -0800 Subject: [PATCH] Fix excluding of drives and directories. --- Scanner.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Scanner.cpp b/Scanner.cpp index 1a4fec2..312e669 100644 --- a/Scanner.cpp +++ b/Scanner.cpp @@ -37,7 +37,6 @@ int32_t CleanupTemporaryFiles() { hFind = FindFirstFile(search.c_str(), &FindFileData); if (hFind != INVALID_HANDLE_VALUE) { do { - filename = FindFileData.cFileName; if ((filename.size() == 1) && (filename == L".")) continue; @@ -536,6 +535,9 @@ int32_t ScanDirectory(CScannerOptions& options, std::wstring directory, std::wst std::wstring file; std::wstring file_phys; + // Checking for excluded directories + if (IsDirectoryExcluded(options, directory)) return ERROR_NO_MORE_ITEMS; + if (options.verbose) { wprintf(L"Processing Directory '%s'\n", directory.c_str()); } @@ -568,9 +570,6 @@ int32_t ScanDirectory(CScannerOptions& options, std::wstring directory, std::wst dir_phys.clear(); } - // Checking for excluded directories - if (IsDirectoryExcluded(options, dir)) continue; - ReportProcessDirectory(); rv = ScanDirectory(options, dir, dir_phys);