diff options
Diffstat (limited to 'dep/CascLib/src/CascRootFile_Mndx.cpp')
-rw-r--r-- | dep/CascLib/src/CascRootFile_Mndx.cpp | 22 |
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); |