From f680c134955b3179265ec197c935ed86b397b6ad Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 9 Jul 2011 01:24:30 +0100 Subject: Fix osMatchString() so that it reports all instance of pattern matches, not just the first one. This is a slight adaptation of the patch in http://opensimulator.org/mantis/view.php?id=4568 which doesn't apply directly since the underlying code was changed by earlier makopoppo patches. Thanks makopoppo! --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b3f90e2..b710229 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1909,8 +1909,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api }; return NotecardCache.GetLines(assetID); - - } public string osAvatarName2Key(string firstname, string lastname) @@ -2024,7 +2022,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Find matches beginning at start position Regex matcher = new Regex(pattern); Match match = matcher.Match(src, start); - if (match.Success) + while (match.Success) { foreach (System.Text.RegularExpressions.Group g in match.Groups) { @@ -2034,6 +2032,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api result.Add(new LSL_Integer(g.Index)); } } + + match = match.NextMatch(); } return result; -- cgit v1.1