diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-16 14:03:48 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-16 14:03:48 -0200 |
commit | 94686ce58554a80374eeff115ee5b87c184ed173 (patch) | |
tree | 9b41f32a05a41f7063df180015c13c5d9ae1d4a0 /table.c | |
parent | 86b35cf4f6a824880239069d0afe282e95806aaa (diff) | |
download | lua-94686ce58554a80374eeff115ee5b87c184ed173.tar.gz lua-94686ce58554a80374eeff115ee5b87c184ed173.tar.bz2 lua-94686ce58554a80374eeff115ee5b87c184ed173.zip |
correction of function 'nextvar'
Diffstat (limited to 'table.c')
-rw-r--r-- | table.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Module to control static tables | 3 | ** Module to control static tables |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_table="$Id: table.c,v 2.16 1994/11/11 14:00:08 roberto Exp roberto $"; | 6 | char *rcs_table="$Id: table.c,v 2.17 1994/11/14 21:40:14 roberto Exp $"; |
7 | 7 | ||
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <string.h> | 9 | #include <string.h> |
@@ -41,6 +41,8 @@ Word lua_nentity; /* counter of new entities (strings and arrays) */ | |||
41 | Word lua_recovered; /* counter of recovered entities (strings and arrays) */ | 41 | Word lua_recovered; /* counter of recovered entities (strings and arrays) */ |
42 | 42 | ||
43 | 43 | ||
44 | static void lua_nextvar (void); | ||
45 | |||
44 | /* | 46 | /* |
45 | ** Initialise symbol table with internal functions | 47 | ** Initialise symbol table with internal functions |
46 | */ | 48 | */ |
@@ -239,9 +241,10 @@ char *lua_filename (void) | |||
239 | /* | 241 | /* |
240 | ** Internal function: return next global variable | 242 | ** Internal function: return next global variable |
241 | */ | 243 | */ |
242 | void lua_nextvar (void) | 244 | static void lua_nextvar (void) |
243 | { | 245 | { |
244 | char *varname, *next; | 246 | char *varname; |
247 | TreeNode *next; | ||
245 | lua_Object o = lua_getparam(1); | 248 | lua_Object o = lua_getparam(1); |
246 | if (o == 0) | 249 | if (o == 0) |
247 | lua_error ("too few arguments to function `nextvar'"); | 250 | lua_error ("too few arguments to function `nextvar'"); |
@@ -266,8 +269,8 @@ void lua_nextvar (void) | |||
266 | { | 269 | { |
267 | Object name; | 270 | Object name; |
268 | tag(&name) = LUA_T_STRING; | 271 | tag(&name) = LUA_T_STRING; |
269 | svalue(&name) = next; | 272 | svalue(&name) = next->str; |
270 | luaI_pushobject(&name); | 273 | luaI_pushobject(&name); |
271 | luaI_pushobject(&s_object(indexstring(next))); | 274 | luaI_pushobject(&s_object(next->varindex)); |
272 | } | 275 | } |
273 | } | 276 | } |