mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Explicitly roll over to zero when the element isn't found.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26870 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
500adbbfd3
commit
0871d54a82
2 changed files with 10 additions and 1 deletions
|
@ -925,7 +925,10 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
|
|||
if (self == sharedDefaults) invalidatedLanguages = YES;
|
||||
[_searchList removeObject: aName];
|
||||
index = [_searchList indexOfObject: processName];
|
||||
index++; // NSNotFound wraps to zero ... insert at start.
|
||||
if(index == NSNotFound)
|
||||
{
|
||||
index = 0; // NSNotFound, insert at start.
|
||||
}
|
||||
aName = [aName copy];
|
||||
[_searchList insertObject: aName atIndex: index];
|
||||
[_lock unlock];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue