diff options
author | Justin Clarke Casey | 2008-10-16 17:14:02 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-16 17:14:02 +0000 |
commit | 4df08aed304875e1e435272a92d58bf20a1bbe4d (patch) | |
tree | 1b643dcfcb84a5a9d24f69955f83afe824368fb2 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | fix line endings, as apparently the bot didn't do this yet (diff) | |
download | opensim-SC_OLD-4df08aed304875e1e435272a92d58bf20a1bbe4d.zip opensim-SC_OLD-4df08aed304875e1e435272a92d58bf20a1bbe4d.tar.gz opensim-SC_OLD-4df08aed304875e1e435272a92d58bf20a1bbe4d.tar.bz2 opensim-SC_OLD-4df08aed304875e1e435272a92d58bf20a1bbe4d.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=2401
* Removes spacers that are also separators in llParseString2List
* Thanks idb
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 22 |
1 files changed, 21 insertions, 1 deletions
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 | |||
4598 | // ScriptSleep(5000); | 4598 | // ScriptSleep(5000); |
4599 | } | 4599 | } |
4600 | 4600 | ||
4601 | public LSL_List llParseString2List(string str, LSL_List separators, LSL_List spacers) | 4601 | public LSL_List llParseString2List(string str, LSL_List separators, LSL_List in_spacers) |
4602 | { | 4602 | { |
4603 | m_host.AddScriptLPS(1); | 4603 | m_host.AddScriptLPS(1); |
4604 | LSL_List ret = new LSL_List(); | 4604 | LSL_List ret = new LSL_List(); |
4605 | LSL_List spacers = new LSL_List(); | ||
4606 | if (in_spacers.Length > 0 && separators.Length > 0) | ||
4607 | { | ||
4608 | for (int i = 0; i < in_spacers.Length; i++) | ||
4609 | { | ||
4610 | object s = in_spacers.Data[i]; | ||
4611 | for (int j = 0; j < separators.Length; j++) | ||
4612 | { | ||
4613 | if (separators.Data[j].ToString() == s.ToString()) | ||
4614 | { | ||
4615 | s = null; | ||
4616 | break; | ||
4617 | } | ||
4618 | } | ||
4619 | if (s != null) | ||
4620 | { | ||
4621 | spacers.Add(s); | ||
4622 | } | ||
4623 | } | ||
4624 | } | ||
4605 | object[] delimiters = new object[separators.Length + spacers.Length]; | 4625 | object[] delimiters = new object[separators.Length + spacers.Length]; |
4606 | separators.Data.CopyTo(delimiters, 0); | 4626 | separators.Data.CopyTo(delimiters, 0); |
4607 | spacers.Data.CopyTo(delimiters, separators.Length); | 4627 | spacers.Data.CopyTo(delimiters, separators.Length); |