Commit bdc0d42e authored by goro's avatar goro
Browse files

Make patcher not abort on errors

parent fc67b043
...@@ -85,13 +85,13 @@ bool patchBinaryWithQtPathes(const char *fileName, const char *baseQtPath) ...@@ -85,13 +85,13 @@ bool patchBinaryWithQtPathes(const char *fileName, const char *baseQtPath)
logFileName(fileName); logFileName(fileName);
for (int i = 0; i < (int)(sizeof(variables) / sizeof(variables[0])); i++) { for (int i = 0; i < (int)(sizeof(variables) / sizeof(variables[0])); i++) {
const char * const newStr = allocFileNameCopyAppend(variables[i].variable, baseQtPath, variables[i].subDirectory); const char * const newStr = allocFileNameCopyAppend(
variables[i].variable, baseQtPath, variables[i].subDirectory);
BinPatch binFile(fileName); BinPatch binFile(fileName);
const bool success = binFile.patch(variables[i].variable, newStr); const bool success = binFile.patch(variables[i].variable, newStr);
delete[] newStr; delete[] newStr;
if (!success) { if (!success) {
result = false; result = false;
break;
} }
} }
...@@ -119,7 +119,6 @@ bool patchBinariesWithQtPathes(const char *baseQtPath) ...@@ -119,7 +119,6 @@ bool patchBinariesWithQtPathes(const char *baseQtPath)
delete[] fileName; delete[] fileName;
if (!success) { if (!success) {
result = false; result = false;
break;
} }
} }
...@@ -602,9 +601,6 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) ...@@ -602,9 +601,6 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath)
delete[] fileName; delete[] fileName;
delete[] oldSourcePath; delete[] oldSourcePath;
delete[] newSourcePath; delete[] newSourcePath;
if (!result)
break;
} }
return result; return result;
...@@ -774,8 +770,8 @@ int main(int argc, char *args[]) ...@@ -774,8 +770,8 @@ int main(int argc, char *args[])
break; break;
patchTextFiles(baseQtPath); patchTextFiles(baseQtPath);
const bool success = patchBinariesWithQtPathes(baseQtPath) const bool successOne = patchBinariesWithQtPathes(baseQtPath);
&& patchDebugLibrariesWithQtPath(baseQtPath); const bool successTwo = patchDebugLibrariesWithQtPath(baseQtPath);
delete[] baseQtPath; delete[] baseQtPath;
return success ? 0 : 1; return (successOne && successTwo) ? 0 : 1;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment