fix iteration through list from previous commit
if last item was removed, 'it' would be set to Patterns.end() and then for loop was incrementing 'it', bypassing conditional for exit by that.
This commit is contained in:
1 parent
deb23548ce
commit
6cc4eac00e
1 file changed
+5
-1
+5
-1
@@ -458,9 +458,13 @@ void TagEditor::EnterPressed()
|
|||||||
}
|
}
|
||||||
else if (success)
|
else if (success)
|
||||||
{
|
{
|
||||||
for (std::list<std::string>::iterator it = Patterns.begin(); it != Patterns.end(); ++it)
|
for (std::list<std::string>::iterator it = Patterns.begin(); ; ++it)
|
||||||
|
{
|
||||||
if (*it == Config.pattern)
|
if (*it == Config.pattern)
|
||||||
it = Patterns.erase(it);
|
it = Patterns.erase(it);
|
||||||
|
if (it == Patterns.end())
|
||||||
|
break;
|
||||||
|
}
|
||||||
Patterns.insert(Patterns.begin(), Config.pattern);
|
Patterns.insert(Patterns.begin(), Config.pattern);
|
||||||
quit = 1;
|
quit = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user