aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ltests.c8
-rw-r--r--ltests.h4
-rw-r--r--lua.c14
3 files changed, 14 insertions, 12 deletions
diff --git a/ltests.c b/ltests.c
index 0fbf0426..7f431343 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.62 2001/02/02 15:13:05 roberto Exp roberto $ 2** $Id: ltests.c,v 1.63 2001/02/06 16:01:29 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -652,12 +652,6 @@ void luaB_opentests (lua_State *L) {
652 luaL_openl(L, tests_funcs); /* open functions inside new table */ 652 luaL_openl(L, tests_funcs); /* open functions inside new table */
653 lua_setglobals(L); /* restore old table of globals */ 653 lua_setglobals(L); /* restore old table of globals */
654 lua_setglobal(L, "T"); /* set new table as global T */ 654 lua_setglobal(L, "T"); /* set new table as global T */
655 /* open other libraries */
656 lua_baselibopen(L);
657 lua_iolibopen(L);
658 lua_strlibopen(L);
659 lua_mathlibopen(L);
660 lua_dblibopen(L);
661} 655}
662 656
663#endif 657#endif
diff --git a/ltests.h b/ltests.h
index e892f710..1d29b82a 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 1.2 2001/02/05 19:08:01 roberto Exp roberto $ 2** $Id: ltests.h,v 1.3 2001/02/06 16:01:29 roberto Exp roberto $
3** Internal Header for Debugging of the Lua Implementation 3** Internal Header for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -49,7 +49,7 @@ extern lua_State *lua_state;
49 49
50void luaB_opentests (lua_State *L); 50void luaB_opentests (lua_State *L);
51 51
52#define LUA_USERINIT(L) luaB_opentests(L) 52#define LUA_USERINIT(L) (luaB_opentests(L), openstdlibs(L))
53 53
54 54
55#endif 55#endif
diff --git a/lua.c b/lua.c
index a7b80e5f..bf87237b 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.57 2001/01/22 18:01:38 roberto Exp roberto $ 2** $Id: lua.c,v 1.58 2001/01/26 11:45:51 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -30,8 +30,7 @@ static int isatty (int x) { return x==0; } /* assume stdin is a tty */
30 30
31 31
32#ifndef LUA_USERINIT 32#ifndef LUA_USERINIT
33#define LUA_USERINIT(L) (lua_baselibopen(L), lua_iolibopen(L), \ 33#define LUA_USERINIT(L) openstdlibs(L)
34 lua_strlibopen(L), lua_mathlibopen(L), lua_dblibopen(L))
35#endif 34#endif
36 35
37 36
@@ -310,6 +309,15 @@ static void register_getargs (char *argv[]) {
310} 309}
311 310
312 311
312static void openstdlibs (lua_State *l) {
313 lua_baselibopen(l);
314 lua_iolibopen(l);
315 lua_strlibopen(l);
316 lua_mathlibopen(l);
317 lua_dblibopen(l);
318}
319
320
313int main (int argc, char *argv[]) { 321int main (int argc, char *argv[]) {
314 struct Options opt; 322 struct Options opt;
315 int status; 323 int status;