From 3f150fbcf19cdfa205da1576386edc6ef2db1bda Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 31 May 2024 17:44:29 +0300 Subject: viewer#1594 Add a "Cancel" button to exit the "New List" prompt And fix infinite loop in replaceList. mLists[search_index] was extending size of the list indefinetely. --- indra/newview/llautoreplace.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llautoreplace.cpp') diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index e1d494f7c7..08e09d2d22 100644 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -536,11 +536,12 @@ LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::replaceList(const LL S32 search_index; LLSD targetList; // The following is working around the fact that LLSD arrays containing maps also seem to have undefined entries... see LLSD-30 - for ( search_index = 0, targetList = mLists[0]; + for ( search_index = 0; !listFound && search_index < mLists.size(); - search_index += 1, targetList = mLists[search_index] + search_index += 1 ) { + targetList = mLists[search_index]; if ( targetList.isMap() ) { if ( listNameMatches( targetList, listName) ) -- cgit v1.3