aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKim King2011-05-16 05:57:08 -0400
committerJustin Clark-Casey (justincc)2011-05-20 20:00:55 +0100
commita2c19847b4bb9b2335622bfc9757e6f7a2971c7d (patch)
tree8c1e0f5c69754472b3d0c5f7ea7dd5ff80441874
parentAllow item links to be deleted even when other deletes and purges are disabled. (diff)
downloadopensim-SC_OLD-a2c19847b4bb9b2335622bfc9757e6f7a2971c7d.zip
opensim-SC_OLD-a2c19847b4bb9b2335622bfc9757e6f7a2971c7d.tar.gz
opensim-SC_OLD-a2c19847b4bb9b2335622bfc9757e6f7a2971c7d.tar.bz2
opensim-SC_OLD-a2c19847b4bb9b2335622bfc9757e6f7a2971c7d.tar.xz
ScriptEngine/Shared: Fix bug 5473 (v2).
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 298d664..461b473 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1536,6 +1536,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
1536 public struct LSLInteger 1536 public struct LSLInteger
1537 { 1537 {
1538 public int value; 1538 public int value;
1539 private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");
1539 1540
1540 #region Constructors 1541 #region Constructors
1541 public LSLInteger(int i) 1542 public LSLInteger(int i)
@@ -1555,9 +1556,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
1555 1556
1556 public LSLInteger(string s) 1557 public LSLInteger(string s)
1557 { 1558 {
1558 Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)"); 1559 Match m = castRegex.Match(s);
1559 Match m = r.Match(s);
1560 string v = m.Groups[0].Value; 1560 string v = m.Groups[0].Value;
1561 // Leading plus sign is allowed, but ignored
1562 v = v.Replace("+", "");
1561 1563
1562 if (v == String.Empty) 1564 if (v == String.Empty)
1563 { 1565 {