aboutsummaryrefslogtreecommitdiff
path: root/src/SFileListFile.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avg.com>2014-09-18 09:24:24 +0200
committerLadislav Zezula <ladislav.zezula@avg.com>2014-09-18 09:24:24 +0200
commit1aa906cf21accf9d82b39340c1a7b5b54a9440e1 (patch)
treea293d22fad682fc5357dc6f3216886b839f0df80 /src/SFileListFile.cpp
parent6ffbb6a7f6d7d8888733f158f04894a572589e8a (diff)
+ SFileAddListFile now returns proper error code if the file cannot be added.
Diffstat (limited to 'src/SFileListFile.cpp')
-rw-r--r--src/SFileListFile.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp
index ed549d1..3428bcc 100644
--- a/src/SFileListFile.cpp
+++ b/src/SFileListFile.cpp
@@ -452,12 +452,12 @@ static int SFileAddExternalListFile(
int nError = ERROR_SUCCESS;
// Open the external list file
- if(SFileOpenFileEx(hMpq, szListFile, SFILE_OPEN_LOCAL_FILE, &hListFile))
- {
- // Add the data from the listfile to MPQ
- nError = SFileAddArbitraryListFile(ha, hListFile);
- SFileCloseFile(hListFile);
- }
+ if(!SFileOpenFileEx(hMpq, szListFile, SFILE_OPEN_LOCAL_FILE, &hListFile))
+ return GetLastError();
+
+ // Add the data from the listfile to MPQ
+ nError = SFileAddArbitraryListFile(ha, hListFile);
+ SFileCloseFile(hListFile);
return nError;
}
@@ -524,9 +524,9 @@ int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile)
while(ha != NULL)
{
if(szListFile != NULL)
- SFileAddExternalListFile(ha, hMpq, szListFile);
+ nError = SFileAddExternalListFile(ha, hMpq, szListFile);
else
- SFileAddInternalListFile(ha, hMpq);
+ nError = SFileAddInternalListFile(ha, hMpq);
// Also, add three special files to the listfile:
// (listfile) itself, (attributes) and (signature)