diff options
author | Melanie Thielker | 2008-09-28 19:58:54 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-28 19:58:54 +0000 |
commit | 3012bfa2a2ff97cc18c02cba7b533cfa818dfee4 (patch) | |
tree | a836d34fea056528688ea4371fefe588a8c6327d /OpenSim | |
parent | Add some methods to allow modules so set client view options (diff) | |
download | opensim-SC-3012bfa2a2ff97cc18c02cba7b533cfa818dfee4.zip opensim-SC-3012bfa2a2ff97cc18c02cba7b533cfa818dfee4.tar.gz opensim-SC-3012bfa2a2ff97cc18c02cba7b533cfa818dfee4.tar.bz2 opensim-SC-3012bfa2a2ff97cc18c02cba7b533cfa818dfee4.tar.xz |
Mantis #1922
Thank you, idb, for a patch that addresses hex digits erroneously being
recognized as valid and parsed in a decimal number
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 4c4eff9..5f8b541 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 | |||
1436 | 1436 | ||
1437 | public LSLInteger(string s) | 1437 | public LSLInteger(string s) |
1438 | { | 1438 | { |
1439 | Regex r = new Regex("^[ ]*-?[0-9][0-9xX]?[0-9a-fA-F]*"); | 1439 | Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)"); |
1440 | Match m = r.Match(s); | 1440 | Match m = r.Match(s); |
1441 | string v = m.Groups[0].Value; | 1441 | string v = m.Groups[0].Value; |
1442 | 1442 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_TypesTestLSLInteger.cs index 957a3b6..1d3ffd5 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 | |||
64 | m_stringIntSet.Add("-99999999", -99999999); | 64 | m_stringIntSet.Add("-99999999", -99999999); |
65 | m_stringIntSet.Add("", 0); | 65 | m_stringIntSet.Add("", 0); |
66 | m_stringIntSet.Add("aa", 0); | 66 | m_stringIntSet.Add("aa", 0); |
67 | m_stringIntSet.Add("56foo", 56); | ||
67 | m_stringIntSet.Add("42", 42); | 68 | m_stringIntSet.Add("42", 42); |
68 | m_stringIntSet.Add("42 is the answer", 42); | 69 | m_stringIntSet.Add("42 is the answer", 42); |
69 | m_stringIntSet.Add(" 42", 42); | 70 | m_stringIntSet.Add(" 42", 42); |