Skip to content

Commit c03aa99

Browse files
Zegerieagleivg
authored andcommitted
LocatorAPI: Register files recursively in Recurse
From the name of the function and the fact that CLocatorAPI::ProcessOne function is prepared for recursion, I guess CLocatorAPI::Recurse was supposed to be recursive (except when bNoRecurse is 'true'). On the other hand, the pattern *.* excludes most folders.
1 parent c4efd92 commit c03aa99

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/xrCore/LocatorAPI.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ bool CLocatorAPI::Recurse(pcstr path)
652652
if (!stat(scanPath, &buffer))
653653
return true;
654654
xr_strcpy(scanPath, sizeof scanPath, path);
655-
xr_strcat(scanPath, "*.*");
655+
xr_strcat(scanPath, "*");
656656
_finddata_t findData;
657657
#ifdef WINDOWS
658658
intptr_t handle = _findfirst(scanPath, &findData);
@@ -680,6 +680,12 @@ bool CLocatorAPI::Recurse(pcstr path)
680680
struct stat fi;
681681
stat(findData.name, &fi);
682682
findData.size = fi.st_size;
683+
switch (fi.st_mode & S_IFMT)
684+
{
685+
case S_IFDIR: findData.attrib = _A_SUBDIR; break;
686+
case S_IFREG: findData.attrib = 0; break; // File
687+
default: findData.attrib = _A_HIDDEN; break; // Skip
688+
}
683689
#endif
684690
string1024 fullPath;
685691
bool ignore = false;

0 commit comments

Comments
 (0)