From b539670eac4139a1c9cf7decd6f993d3cf504c32 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 23 Jan 2016 18:49:10 +0100 Subject: [PATCH] Fixed: Display an error if adding more than once the same filename in BNP --- code/nel/tools/misc/bnp_make/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/misc/bnp_make/main.cpp b/code/nel/tools/misc/bnp_make/main.cpp index edab782b0..98ddf84d6 100644 --- a/code/nel/tools/misc/bnp_make/main.cpp +++ b/code/nel/tools/misc/bnp_make/main.cpp @@ -92,22 +92,32 @@ void packSubRecurse(const std::string &srcDirectory) printf ("Treating directory: %s\n", srcDirectory.c_str()); CPath::getPathContent(srcDirectory, true, false, true, pathContent); - // TODO: remove duplicate files + if (pathContent.empty()) return; // Sort filename sort (pathContent.begin(), pathContent.end(), i_comp); + // check for files with same name + for(uint i = 1, len = pathContent.size(); i < len; ++i) + { + if (toLower(CFile::getFilename(pathContent[i-1])) == toLower(CFile::getFilename(pathContent[i]))) + { + nlerror("File %s is not unique in BNP!", CFile::getFilename(pathContent[i]).c_str()); + return; + } + } + for (uint i=0; i