From 0c3d9d81787ac41bdcf7de12bd00551dd1b2f706 Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 21 Dec 2011 09:50:08 -0600 Subject: [PATCH] merge --- code/ryzom/tools/patch_gen/patch_gen_common.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/ryzom/tools/patch_gen/patch_gen_common.cpp b/code/ryzom/tools/patch_gen/patch_gen_common.cpp index fc39e9fcf..c746fcd00 100644 --- a/code/ryzom/tools/patch_gen/patch_gen_common.cpp +++ b/code/ryzom/tools/patch_gen/patch_gen_common.cpp @@ -18,8 +18,11 @@ // includes //----------------------------------------------------------------------------- +#include + #include "game_share/bnp_patch.h" #include "nel/misc/path.h" +#include "nel/misc/file.h" #include "nel/misc/command.h" #include "nel/misc/sstring.h" #include "game_share/singleton_registry.h" @@ -320,7 +323,6 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const for (uint32 i=packageIndex.fileCount();i--;) { - bool deleteRefAfterDelta= true; // generate file name root std::string bnpFileName= _BnpDirectory+packageIndex.getFile(i).getFileName(); std::string refNameRoot= _RefDirectory+NLMISC::CFile::getFilenameWithoutExtension(bnpFileName); @@ -340,8 +342,9 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const std::string prevVersionFileName; if (packageIndex.getFile(i).versionCount()==1) { - prevVersionFileName= "nul"; - deleteRefAfterDelta= false; + prevVersionFileName= tmpnam(NULL); + NLMISC::COFile tmpFile(prevVersionFileName); + tmpFile.close(); } else { @@ -400,7 +403,7 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const } // if we have a ref file still hanging about from the previous patch then delete it - if (prevVersionFileName!= "nul" && NLMISC::CFile::fileExists(prevVersionFileName)) + if (NLMISC::CFile::fileExists(prevVersionFileName)) { NLMISC::CFile::deleteFile(prevVersionFileName); }