Fixes for bugs shaken out in the recent push: die properly for nil

indexes in slices.  Fix string conversion issue with bare "+" and "-".
Fix lexing of exponent expressions such that "1e" is not a number.
This commit is contained in:
andy
2008-09-30 16:48:36 +00:00
parent 8174005ac8
commit 818359bfd0
4 changed files with 8 additions and 8 deletions
+1 -3
View File
@@ -185,9 +185,7 @@ static int tonum(unsigned char* s, int len, double* result)
int i=0, fraclen=0;
double sgn=1, val, frac=0, exp=0;
// Special case, "." is not a number, even though "1." and ".0" are.
if(len == 1 && s[0] == '.')
return 0;
if(len == 1 && (*s=='.' || *s=='-' || *s=='+')) return 0;
// Strip off the leading negative sign first, so we can correctly
// parse things like -.xxx which would otherwise confuse