diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 4c4eff98ac..5f8b541e19 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1436,7 +1436,7 @@ namespace OpenSim.Region.ScriptEngine.Shared public LSLInteger(string s) { - Regex r = new Regex("^[ ]*-?[0-9][0-9xX]?[0-9a-fA-F]*"); + Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)"); Match m = r.Match(s); string v = m.Groups[0].Value; diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs index 957a3b6a63..1d3ffd5e9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs @@ -64,6 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests m_stringIntSet.Add("-99999999", -99999999); m_stringIntSet.Add("", 0); m_stringIntSet.Add("aa", 0); + m_stringIntSet.Add("56foo", 56); m_stringIntSet.Add("42", 42); m_stringIntSet.Add("42 is the answer", 42); m_stringIntSet.Add(" 42", 42);