diff options
author | Ladislav <Zezula> | 2013-10-11 21:40:00 +0200 |
---|---|---|
committer | Ladislav <Zezula> | 2013-10-11 21:40:00 +0200 |
commit | c59aa13d57bbd0adf6662ef3266a3943c7e5960f (patch) | |
tree | e4983e25b5b3f708e64b22608cc5d86abcc516ff /src/SFileListFile.cpp | |
parent | 38655d66d94f958402ce65380f5373c7245c8e55 (diff) |
+ (Perhaps) finally updated ZLIB so the fucking GIT will not downgrade it on next pull
+ Dmitry Vortex issues
Diffstat (limited to 'src/SFileListFile.cpp')
-rw-r--r-- | src/SFileListFile.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp index 38a9601..6ad7ed2 100644 --- a/src/SFileListFile.cpp +++ b/src/SFileListFile.cpp @@ -334,7 +334,7 @@ int SListFileSaveToMpq(TMPQArchive * ha) // Count all next items for(i = 1; i < nFileNodes; i++) { - // If the item is the same like the last one, skip it + // If the item is different from the previous one, include its size to the file size if(_stricmp(SortTable[i], szPrevItem)) { dwFileSize += (DWORD)strlen(SortTable[i]) + 2; @@ -597,30 +597,34 @@ bool WINAPI SListFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData { TListFileCache * pCache = (TListFileCache *)hFind; size_t nLength; - bool bResult = false; int nError = ERROR_SUCCESS; - for(;;) + // Check for parameters + if(pCache != NULL) { - // Read the (next) line - nLength = ReadListFileLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName)); - if(nLength == 0) + for(;;) { - nError = ERROR_NO_MORE_FILES; - break; - } + // Read the (next) line + nLength = ReadListFileLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName)); + if(nLength == 0) + { + nError = ERROR_NO_MORE_FILES; + break; + } - // If some mask entered, check it - if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask)) - { - bResult = true; - break; + // If some mask entered, check it + if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask)) + break; } } + else + { + nError = ERROR_INVALID_PARAMETER; + } if(nError != ERROR_SUCCESS) SetLastError(nError); - return bResult; + return (nError == ERROR_SUCCESS); } bool WINAPI SListFileFindClose(HANDLE hFind) |