From e549b5db4c8a02b8a4b9cce9477720c103d8e339 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Wed, 8 Nov 2017 18:17:52 +0100 Subject: + Tilde can now be a part of file name in the MPQ --- src/SFileListFile.cpp | 28 ++++------------------------ test/StormTest.cpp | Bin 346798 -> 347258 bytes 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp index 3fa695f..57ef7f9 100644 --- a/src/SFileListFile.cpp +++ b/src/SFileListFile.cpp @@ -265,7 +265,6 @@ static char * ReadListFileLine(TListFileCache * pCache, size_t * PtrLength) { LPBYTE pbLineBegin; LPBYTE pbLineEnd; - LPBYTE pbExtraString = NULL; // Skip newlines. Keep spaces and tabs, as they can be a legal part of the file name while(pCache->pPos < pCache->pEnd && (pCache->pPos[0] == 0x0A || pCache->pPos[0] == 0x0D)) @@ -276,32 +275,13 @@ static char * ReadListFileLine(TListFileCache * pCache, size_t * PtrLength) return NULL; pbLineBegin = pbLineEnd = pCache->pPos; - // Copy the remaining characters + // Find the end of the line while(pCache->pPos < pCache->pEnd && pCache->pPos[0] != 0x0A && pCache->pPos[0] != 0x0D) - { - // Blizzard listfiles can also contain information about patch: - // Pass1\Files\MacOS\unconditional\user\Background Downloader.app\Contents\Info.plist~Patch(Data#frFR#base-frFR,1326) - if(pCache->pPos[0] == '~') - pbExtraString = pCache->pPos; - - // Copy the character pCache->pPos++; - } - // If there was extra string after the file name, clear it - if(pbExtraString != NULL) - { - if(pbExtraString[0] == '~' && pbExtraString[1] == 'P') - { - pbLineEnd = pbExtraString; - pbLineEnd[0] = 0; - } - } - else - { - pbLineEnd = pCache->pPos++; - pbLineEnd[0] = 0; - } + // Remember the end of the line + pbLineEnd = pCache->pPos++; + pbLineEnd[0] = 0; // Give the line to the caller if(PtrLength != NULL) diff --git a/test/StormTest.cpp b/test/StormTest.cpp index a8ecf77..4763d77 100644 Binary files a/test/StormTest.cpp and b/test/StormTest.cpp differ -- cgit v1.2.3