Mantis #1922
Thank you, idb, for a patch that addresses hex digits erroneously being recognized as valid and parsed in a decimal number0.6.0-stable
parent
1d5b2bb8bc
commit
3012bfa2a2
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue