From e78f83c394bc1257d86ba8a9c8009f77cf32f94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 23 Aug 2022 02:42:09 +0200 Subject: Formatting. --- c/ext.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/c/ext.cpp b/c/ext.cpp index ee2c943..04ab096 100644 --- a/c/ext.cpp +++ b/c/ext.cpp @@ -88,22 +88,20 @@ static bool FindMatchingFile(wchar_t (&file)[MAX_PATH], const wchar_t* const roo WIN32_FIND_DATA fdata; FindHandle h = FindFirstFile(pat, &fdata); - do { + do if (fdata.cFileName[0] == L'.') - continue; - if (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + ; + else if (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { /* Recurse into directory. */ wchar_t root2[MAX_PATH]; Swprintf(root2, L"%s\\%s", root, fdata.cFileName); if (FindMatchingFile(file, root2, siEp, level+1)) return true; + } else if (MatchFileName(fdata.cFileName, siEp)) { + Swprintf(file, L"%s\\%s", root, fdata.cFileName); + return true; } - else /* Try to match file name. */ - if (MatchFileName(fdata.cFileName, siEp)) { - Swprintf(file, L"%s\\%s", root, fdata.cFileName); - return true; - } - } while (FindNextFile(h, &fdata)); + while (FindNextFile(h, &fdata)); if (GetLastError() != ERROR_NO_MORE_FILES) throw Win32Error(); -- cgit v1.2.3