mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
ScriptEngine/Shared: Fix bug 5473 (v2).
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
bdd7849094
commit
a2c19847b4
@@ -1536,6 +1536,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
public struct LSLInteger
|
||||
{
|
||||
public int value;
|
||||
private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");
|
||||
|
||||
#region Constructors
|
||||
public LSLInteger(int i)
|
||||
@@ -1555,9 +1556,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public LSLInteger(string s)
|
||||
{
|
||||
Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)");
|
||||
Match m = r.Match(s);
|
||||
Match m = castRegex.Match(s);
|
||||
string v = m.Groups[0].Value;
|
||||
// Leading plus sign is allowed, but ignored
|
||||
v = v.Replace("+", "");
|
||||
|
||||
if (v == String.Empty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user