diff options
Diffstat (limited to 'indra/newview/llconversationlog.cpp')
-rw-r--r-- | indra/newview/llconversationlog.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 03d1647c5e..4be169e267 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -31,6 +31,8 @@ #include "llnotificationsutil.h" #include "lltrans.h" +#include "boost/lexical_cast.hpp" + const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days by spec struct ConversationParams @@ -382,13 +384,12 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s { std::string backupFileName; - UINT backupFileCount = 0; + unsigned backupFileCount = 0; - //Does the file exist in the current path - if(LLFile::isfile(originDirectory)) + //Does the file exist in the current path, if it does lets move it + if(LLFile::isfile(originDirectory)) { - - //File already exists so make a backup file + //The target directory contains that file already, so lets store it if(LLFile::isfile(targetDirectory)) { backupFileName = targetDirectory + ".backup"; @@ -396,19 +397,15 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s //If needed store backup file as .backup1 etc. while(LLFile::isfile(backupFileName)) { - backupFileName = targetDirectory + ".backup"; - - if(backupFileCount) - { - backupFileName += backupFileCount; - } + ++backupFileCount; + backupFileName = targetDirectory + ".backup" + boost::lexical_cast<std::string>(backupFileCount); } //Rename the file to its backup name so it is not overwritten LLFile::rename(targetDirectory, backupFileName); } - //Move the file from the current path to destination path + //Move the file from the current path to target path if(LLFile::rename(originDirectory, targetDirectory) != 0) { return false; |