jira-archive-internal#67837 Fix LLDir::getScrubbedFileName

master
Andrey Kleshchev 2024-06-18 16:23:30 +03:00 committed by Andrey Kleshchev
parent ea83746cda
commit 810219d3bf
1 changed files with 2 additions and 2 deletions

View File

@ -881,10 +881,10 @@ std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
std::string name(uncleanFileName);
const std::string illegalChars(getForbiddenFileChars());
// replace any illegal file chars with and underscore '_'
for( unsigned int i = 0; i < illegalChars.length(); i++ )
for( const char &ch : illegalChars)
{
std::string::size_type j = -1;
while((j = name.find(illegalChars[i])) > std::string::npos)
while((j = name.find(ch)) != std::string::npos)
{
name[j] = '_';
}