diff options
-rw-r--r-- | inout.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.16 1994/12/20 21:20:36 roberto Exp celes $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.17 1995/03/17 20:27:11 celes Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
@@ -235,9 +235,11 @@ void lua_print (void) | |||
235 | void luaI_type (void) | 235 | void luaI_type (void) |
236 | { | 236 | { |
237 | lua_Object o = lua_getparam(1); | 237 | lua_Object o = lua_getparam(1); |
238 | int t; | ||
238 | if (o == LUA_NOOBJECT) | 239 | if (o == LUA_NOOBJECT) |
239 | lua_error("no parameter to function 'type'"); | 240 | lua_error("no parameter to function 'type'"); |
240 | switch (lua_type(o)) | 241 | t = lua_type(o); |
242 | switch (t) | ||
241 | { | 243 | { |
242 | case LUA_T_NIL : | 244 | case LUA_T_NIL : |
243 | lua_pushliteral("nil"); | 245 | lua_pushliteral("nil"); |
@@ -261,6 +263,7 @@ void luaI_type (void) | |||
261 | lua_pushliteral("userdata"); | 263 | lua_pushliteral("userdata"); |
262 | break; | 264 | break; |
263 | } | 265 | } |
266 | lua_pushnumber(t); | ||
264 | } | 267 | } |
265 | 268 | ||
266 | /* | 269 | /* |