Fix regex for string->int cast to accept leading spaces and a sign

0.6.0-stable
Melanie Thielker 2008-09-02 06:43:16 +00:00
parent 14a218dbc9
commit f13a48fe1c
1 changed files with 1 additions and 1 deletions

View File

@ -1394,7 +1394,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
static public explicit operator LSLInteger(string s)
{
Regex r = new Regex("^[0-9][0-9]*");
Regex r = new Regex("^[ ]*-?[0-9][0-9]*");
Match m = r.Match(s);
string v = m.Groups[0].Value;