mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
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!
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user