From d5b3a66f524b2709c819c90bcc2d9396218c9306 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 3 Oct 2008 02:33:59 +0000 Subject: Mantis#2307. Thank you kindly, Godfrey for a patch that solves: In Second Life's implementation of llParseString2List(), all spacer strings which occur within the source string are included in the resulting list. In OpenSim's implementation, any spacers occurring at the beginning of the string are discarded; furthermore, if multiple spacers occur between non-spacer elements, or at the end of the source string, only the first spacer is added to the resulting list; the remainder are discarded. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39636b6..4ae4fe2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4696,20 +4696,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (cindex > 0) { ret.Add(str.Substring(0, cindex)); - // Cannot use spacers.Contains() because spacers may be either type String or LSLString - for (int j = 0; j < spacers.Length; j++) + } + // Cannot use spacers.Contains() because spacers may be either type String or LSLString + for (int j = 0; j < spacers.Length; j++) + { + if (spacers.Data[j].ToString() == cdeli) { - if (spacers.Data[j].ToString() == cdeli) - { - ret.Add(cdeli); - break; - } + ret.Add(cdeli); + break; } } - if (cindex == 0 && spacers.Contains(cdeli)) - { - ret.Add(cdeli); - } str = str.Substring(cindex + cdeli.Length); } } while (dfound); -- cgit v1.1