From f481ef1debf003d76ccf05705efa29d7f0ba088e Mon Sep 17 00:00:00 2001 From: acidicMercury8 Date: Tue, 7 Mar 2023 18:53:57 +0300 Subject: [PATCH] Backport filesystem fixes from IX-Ray 1.6 --- src/xrCore/LocatorAPI.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/xrCore/LocatorAPI.cpp b/src/xrCore/LocatorAPI.cpp index b319eef3..5e2de5b3 100644 --- a/src/xrCore/LocatorAPI.cpp +++ b/src/xrCore/LocatorAPI.cpp @@ -486,16 +486,11 @@ bool CLocatorAPI::Recurse (const char* path) _findclose ( hFile ); - u32 count = rec_files.size(); - _finddata_t *buffer = (_finddata_t*)_alloca(count*sizeof(_finddata_t)); - std::copy (&*rec_files.begin(), &*rec_files.begin() + count, buffer); - -//. std::copy (&*rec_files.begin(),&*rec_files.end(),buffer); - + FFVec buffer(rec_files); rec_files.clear(); - std::sort (buffer, buffer + count, pred_str_ff); - for (_finddata_t *I = buffer, *E = buffer + count; I != E; ++I) - ProcessOne (path,I); + std::sort(buffer.begin(), buffer.end(), pred_str_ff); + for (FFIt I = buffer.begin(), E = buffer.end(); I != E; ++I) + ProcessOne(path, &*I); // insert self if (path&&path[0])\