From 0d43aaa337c1ee3752392aa87d49a6d55e555848 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 23 Mar 2008 00:39:35 +0000 Subject: Fix llParseString2List bug when separator is longer than 1 character. --- .../Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 62dcf8c..6438312 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2685,25 +2685,25 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); LSL_Types.list ret = new LSL_Types.list(); - object[] delimeters = new object[separators.Length + spacers.Length]; - separators.Data.CopyTo(delimeters, 0); - spacers.Data.CopyTo(delimeters, separators.Length); + object[] delimiters = new object[separators.Length + spacers.Length]; + separators.Data.CopyTo(delimiters, 0); + spacers.Data.CopyTo(delimiters, separators.Length); bool dfound = false; do { dfound = false; int cindex = -1; string cdeli = ""; - for (int i = 0; i < delimeters.Length; i++) + for (int i = 0; i < delimiters.Length; i++) { - int index = str.IndexOf(delimeters[i].ToString()); + int index = str.IndexOf(delimiters[i].ToString()); bool found = index != -1; if (found) { if ((cindex > index) || (cindex == -1)) { cindex = index; - cdeli = (string)delimeters[i]; + cdeli = (string)delimiters[i]; } dfound = dfound || found; } @@ -2722,16 +2722,14 @@ namespace OpenSim.Region.ScriptEngine.Common { ret.Add(cdeli); } - str = str.Substring(cindex + 1); + str = str.Substring(cindex + cdeli.Length); } - } - while (dfound); + } while (dfound); if (str != "") { ret.Add(str); } return ret; - } public int llOverMyLand(string id) -- cgit v1.1