aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascRootFile_Mndx.cpp
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-05-20 11:04:03 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-05-20 11:04:03 +0200
commitd7d4cadd9ccb862ba4fc4f97d061d3d76ee476c0 (patch)
treef8c07ff4c5e6cd26ca27a3adeb13a40f270653aa /dep/CascLib/src/CascRootFile_Mndx.cpp
parent6a405f8162c2d84eee834875015efe8e43a4f7fd (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@4c04c6c2bf29f44d09b6ba18623859c7295cbd87
Diffstat (limited to 'dep/CascLib/src/CascRootFile_Mndx.cpp')
-rw-r--r--dep/CascLib/src/CascRootFile_Mndx.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/dep/CascLib/src/CascRootFile_Mndx.cpp b/dep/CascLib/src/CascRootFile_Mndx.cpp
index 4a70c1c10f3..1c193ea9498 100644
--- a/dep/CascLib/src/CascRootFile_Mndx.cpp
+++ b/dep/CascLib/src/CascRootFile_Mndx.cpp
@@ -3069,10 +3069,24 @@ static LPBYTE MndxHandler_Search(TRootHandler_MNDX * pRootHandler, TCascSearch *
assert(pSearch->pRootContext != NULL);
pStruct1C = (TMndxFindResult *)pSearch->pRootContext;
- // Search the next file name (our code)
- pMarFile->pDatabasePtr->sub_1956CE0(pStruct1C, &bFindResult);
- if(bFindResult == false)
- return NULL;
+ // Keep searching
+ for(;;)
+ {
+ // Search the next file name (our code)
+ pMarFile->pDatabasePtr->sub_1956CE0(pStruct1C, &bFindResult);
+ if (bFindResult == false)
+ return NULL;
+
+ // If we have no wild mask, we found it
+ if (pSearch->szMask == NULL || pSearch->szMask[0] == 0)
+ break;
+
+ // Copy the found name to the buffer
+ memcpy(pSearch->szFileName, pStruct1C->szFoundPath, pStruct1C->cchFoundPath);
+ pSearch->szFileName[pStruct1C->cchFoundPath] = 0;
+ if (CheckWildCard(pSearch->szFileName, pSearch->szMask))
+ break;
+ }
// Give the file size and encoding key
return FillFindData(pRootHandler, pSearch, pStruct1C, PtrFileSize);