Skip to content

Commit

Permalink
LocatorAPI: Register files recursively in Recurse
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Zegeri authored and eagleivg committed Oct 4, 2018
1 parent c4efd92 commit c03aa99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ bool CLocatorAPI::Recurse(pcstr path)
if (!stat(scanPath, &buffer))
return true;
xr_strcpy(scanPath, sizeof scanPath, path);
xr_strcat(scanPath, "*.*");
xr_strcat(scanPath, "*");
_finddata_t findData;
#ifdef WINDOWS
intptr_t handle = _findfirst(scanPath, &findData);
Expand Down Expand Up @@ -680,6 +680,12 @@ bool CLocatorAPI::Recurse(pcstr path)
struct stat fi;
stat(findData.name, &fi);
findData.size = fi.st_size;
switch (fi.st_mode & S_IFMT)
{
case S_IFDIR: findData.attrib = _A_SUBDIR; break;
case S_IFREG: findData.attrib = 0; break; // File
default: findData.attrib = _A_HIDDEN; break; // Skip
}
#endif
string1024 fullPath;
bool ignore = false;
Expand Down

0 comments on commit c03aa99

Please sign in to comment.