mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-30 07:35:59 +00:00
Fixed: xdelta 1.x returns 2 when an error occurs (0 or 1 is a success)
This commit is contained in:
parent
1373865f60
commit
51255ad648
1 changed files with 6 additions and 2 deletions
|
@ -55,8 +55,10 @@ void GeneratePatch(const std::string& srcFileName,const std::string& destFileNam
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","delta",srcFileName.c_str(),destFileName.c_str(),patchFileName.c_str(),NULL);
|
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","delta",srcFileName.c_str(),destFileName.c_str(),patchFileName.c_str(),NULL);
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
|
// xdelta-1.x behaves like "diff" and returns 0 for identical files, 1 for different files, 2 for errors
|
||||||
sint error = system (cmd.c_str());
|
sint error = system (cmd.c_str());
|
||||||
if (error)
|
|
||||||
|
if (error == 2)
|
||||||
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
@ -69,8 +71,10 @@ void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,c
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","patch",patchFileName.c_str(),srcFileName.c_str(),destFileName.c_str(),NULL);
|
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","patch",patchFileName.c_str(),srcFileName.c_str(),destFileName.c_str(),NULL);
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
|
// xdelta-1.x behaves like "diff" and returns 0 for identical files, 1 for different files, 2 for errors
|
||||||
sint error = system (cmd.c_str());
|
sint error = system (cmd.c_str());
|
||||||
if (error)
|
|
||||||
|
if (error == 2)
|
||||||
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue