Don't compare rbegin() iterators, use LLStringUtil::endsWith().

I think the intention of (sDumpDir.rbegin() == mDirDelimiter.rbegin()) was to
test whether sDumpDir endsWith(mDirDelimiter). But those iterators will never
be equal. Instead, use LLStringUtil::endsWith().
meow-7.2.2
Nat Goodspeed 2018-08-21 19:23:33 -04:00
parent 6a61145686
commit db970c1a5f
1 changed files with 3 additions and 2 deletions

View File

@ -42,6 +42,7 @@
#include "lldiriterator.h"
#include "stringize.h"
#include "llstring.h"
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/range/begin.hpp>
@ -317,9 +318,9 @@ const std::string& LLDir::getChatLogsDir() const
void LLDir::setDumpDir( const std::string& path )
{
LLDir::sDumpDir = path;
if (! sDumpDir.empty() && sDumpDir.rbegin() == mDirDelimiter.rbegin() )
if (LLStringUtil::endsWith(sDumpDir, mDirDelimiter))
{
sDumpDir.erase(sDumpDir.size() -1);
sDumpDir.erase(sDumpDir.size() - mDirDelimiter.size());
}
}