From 4df08aed304875e1e435272a92d58bf20a1bbe4d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 16 Oct 2008 17:14:02 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2401 * Removes spacers that are also separators in llParseString2List * Thanks idb --- .../Shared/Api/Implementation/LSL_Api.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (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 9df318c..d385042 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4598,10 +4598,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // ScriptSleep(5000); } - public LSL_List llParseString2List(string str, LSL_List separators, LSL_List spacers) + public LSL_List llParseString2List(string str, LSL_List separators, LSL_List in_spacers) { m_host.AddScriptLPS(1); LSL_List ret = new LSL_List(); + LSL_List spacers = new LSL_List(); + if (in_spacers.Length > 0 && separators.Length > 0) + { + for (int i = 0; i < in_spacers.Length; i++) + { + object s = in_spacers.Data[i]; + for (int j = 0; j < separators.Length; j++) + { + if (separators.Data[j].ToString() == s.ToString()) + { + s = null; + break; + } + } + if (s != null) + { + spacers.Add(s); + } + } + } object[] delimiters = new object[separators.Length + spacers.Length]; separators.Data.CopyTo(delimiters, 0); spacers.Data.CopyTo(delimiters, separators.Length); -- cgit v1.1