diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 17:10:55 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 17:10:55 -0300 |
commit | f6834f4393eaa1055c2bbde82ebb33cc58be8371 (patch) | |
tree | 3583008ef181106d0fc7e130300f12adc70a5854 /liolib.c | |
parent | 78bc8e553d4190fc3b90be5b621fc0f3507586ef (diff) | |
download | lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.tar.gz lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.tar.bz2 lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.zip |
new API function `lua_type' + new type lua_Type
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 1.84 2000/09/14 14:09:31 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 1.85 2000/09/22 18:14:06 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -449,7 +449,7 @@ static int io_write (lua_State *L) { | |||
449 | if (f) arg++; | 449 | if (f) arg++; |
450 | else f = getfilebyref(L, ctrl, OUTFILE); /* get _OUTPUT */ | 450 | else f = getfilebyref(L, ctrl, OUTFILE); /* get _OUTPUT */ |
451 | for (; arg <= lastarg; arg++) { | 451 | for (; arg <= lastarg; arg++) { |
452 | if (lua_type(L, arg)[2] == 'm') { /* nuMber? */ /* LUA_NUMBER */ | 452 | if (lua_type(L, arg) == LUA_TNUMBER) { /* LUA_NUMBER */ |
453 | /* optimization: could be done exactly as for strings */ | 453 | /* optimization: could be done exactly as for strings */ |
454 | status = status && fprintf(f, "%.16g", lua_tonumber(L, arg)) > 0; | 454 | status = status && fprintf(f, "%.16g", lua_tonumber(L, arg)) > 0; |
455 | } | 455 | } |