aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-04-13 16:28:49 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-04-13 16:28:49 -0300
commit0bbd96bd5f973f716a93a704e04cf1c78145795f (patch)
treec65fbfafcb43b4d4de8a592243d7955ce824073f /lvm.c
parent4eb67aa7107e495bc756f37b7dcc936ee113afd7 (diff)
downloadlua-0bbd96bd5f973f716a93a704e04cf1c78145795f.tar.gz
lua-0bbd96bd5f973f716a93a704e04cf1c78145795f.tar.bz2
lua-0bbd96bd5f973f716a93a704e04cf1c78145795f.zip
details.
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lvm.c b/lvm.c
index 814eba82..db7e3a56 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.53 1999/03/05 21:16:07 roberto Exp roberto $ 2** $Id: lvm.c,v 1.54 1999/03/10 14:09:45 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -57,11 +57,14 @@ int luaV_tonumber (TObject *obj) { /* LUA_NUMBER */
57 char *e = svalue(obj); 57 char *e = svalue(obj);
58 int sig = 1; 58 int sig = 1;
59 while (isspace((unsigned char)*e)) e++; 59 while (isspace((unsigned char)*e)) e++;
60 if (*e == '+') e++; 60 if (*e == '-') {
61 else if (*e == '-') {
62 e++; 61 e++;
63 sig = -1; 62 sig = -1;
64 } 63 }
64 else if (*e == '+') e++;
65 /* no digit before or after decimal point? */
66 if (!isdigit((unsigned char)*e) && !isdigit((unsigned char)*(e+1)))
67 return 2;
65 t = luaO_str2d(e); 68 t = luaO_str2d(e);
66 if (t<0) return 2; 69 if (t<0) return 2;
67 nvalue(obj) = (real)t*sig; 70 nvalue(obj) = (real)t*sig;