aboutsummaryrefslogtreecommitdiff
path: root/c/ext.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-23 02:42:09 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-23 02:42:09 +0200
commite78f83c394bc1257d86ba8a9c8009f77cf32f94f (patch)
treec110c02f02a1fb4986cd436e54f46e4343e7ba4e /c/ext.cpp
parente8fdb0c5555b1a0279a8546485bcdc1b7972bf5b (diff)
downloadEpisodeBrowser-e78f83c394bc1257d86ba8a9c8009f77cf32f94f.tar.gz
Formatting.
Diffstat (limited to 'c/ext.cpp')
-rw-r--r--c/ext.cpp16
1 files 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();