| 530 | } |
| 531 | |
| 532 | static DWORD SFileAddArbitraryListFile( |
| 533 | TMPQArchive * ha, |
| 534 | HANDLE hMpq, |
| 535 | const TCHAR * szListFile, |
| 536 | DWORD dwMaxSize) |
| 537 | { |
| 538 | TListFileCache * pCache = NULL; |
| 539 | |
| 540 | // Create the listfile cache for that file |
| 541 | pCache = CreateListFileCache(hMpq, szListFile, NULL, dwMaxSize, ha->dwFlags); |
| 542 | if(pCache != NULL) |
| 543 | { |
| 544 | char * szFileName; |
| 545 | size_t nLength = 0; |
| 546 | |
| 547 | // Get the next line |
| 548 | while((szFileName = ReadListFileLine(pCache, &nLength)) != NULL) |
| 549 | { |
| 550 | // Add the line to the MPQ |
| 551 | if(nLength != 0) |
| 552 | SListFileCreateNodeForAllLocales(ha, szFileName); |
| 553 | } |
| 554 | |
| 555 | // Delete the cache |
| 556 | FreeListFileCache(pCache); |
| 557 | } |
| 558 | |
| 559 | return (pCache != NULL) ? ERROR_SUCCESS : ERROR_FILE_CORRUPT; |
| 560 | } |
| 561 | |
| 562 | static DWORD SFileAddInternalListFile( |
| 563 | TMPQArchive * ha, |
no test coverage detected