diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-23 02:42:09 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-23 02:42:09 +0200 |
commit | e78f83c394bc1257d86ba8a9c8009f77cf32f94f (patch) | |
tree | c110c02f02a1fb4986cd436e54f46e4343e7ba4e /c | |
parent | e8fdb0c5555b1a0279a8546485bcdc1b7972bf5b (diff) | |
download | EpisodeBrowser-e78f83c394bc1257d86ba8a9c8009f77cf32f94f.tar.gz |
Formatting.
Diffstat (limited to 'c')
-rw-r--r-- | c/ext.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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(); |