aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 2089d509..6b5444bf 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.26 2001/02/22 18:59:59 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.27 2001/02/23 17:17:25 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -35,7 +35,7 @@ static int luaB__ALERT (lua_State *L) {
35*/ 35*/
36static int luaB__ERRORMESSAGE (lua_State *L) { 36static int luaB__ERRORMESSAGE (lua_State *L) {
37 luaL_checktype(L, 1, LUA_TSTRING); 37 luaL_checktype(L, 1, LUA_TSTRING);
38 lua_getglobal(L, l_s(LUA_ALERT)); 38 lua_getglobal(L, LUA_ALERT);
39 if (lua_isfunction(L, -1)) { /* avoid error loop if _ALERT is not defined */ 39 if (lua_isfunction(L, -1)) { /* avoid error loop if _ALERT is not defined */
40 lua_Debug ar; 40 lua_Debug ar;
41 lua_pushliteral(L, l_s("error: ")); 41 lua_pushliteral(L, l_s("error: "));
@@ -305,10 +305,10 @@ static int luaB_call (lua_State *L) {
305 luaL_checktype(L, 2, LUA_TTABLE); 305 luaL_checktype(L, 2, LUA_TTABLE);
306 n = lua_getn(L, 2); 306 n = lua_getn(L, 2);
307 if (!lua_isnull(L, 4)) { /* set new error method */ 307 if (!lua_isnull(L, 4)) { /* set new error method */
308 lua_getglobal(L, l_s(LUA_ERRORMESSAGE)); 308 lua_getglobal(L, LUA_ERRORMESSAGE);
309 err = lua_gettop(L); /* get index */ 309 err = lua_gettop(L); /* get index */
310 lua_pushvalue(L, 4); 310 lua_pushvalue(L, 4);
311 lua_setglobal(L, l_s(LUA_ERRORMESSAGE)); 311 lua_setglobal(L, LUA_ERRORMESSAGE);
312 } 312 }
313 oldtop = lua_gettop(L); /* top before function-call preparation */ 313 oldtop = lua_gettop(L); /* top before function-call preparation */
314 /* push function */ 314 /* push function */
@@ -319,7 +319,7 @@ static int luaB_call (lua_State *L) {
319 status = lua_call(L, n, LUA_MULTRET); 319 status = lua_call(L, n, LUA_MULTRET);
320 if (err != 0) { /* restore old error method */ 320 if (err != 0) { /* restore old error method */
321 lua_pushvalue(L, err); 321 lua_pushvalue(L, err);
322 lua_setglobal(L, l_s(LUA_ERRORMESSAGE)); 322 lua_setglobal(L, LUA_ERRORMESSAGE);
323 } 323 }
324 if (status != 0) { /* error in call? */ 324 if (status != 0) { /* error in call? */
325 if (strchr(options, l_c('x'))) 325 if (strchr(options, l_c('x')))
@@ -637,8 +637,8 @@ static void deprecated_funcs (lua_State *L) {
637/* }====================================================== */ 637/* }====================================================== */
638 638
639static const luaL_reg base_funcs[] = { 639static const luaL_reg base_funcs[] = {
640 {l_s(LUA_ALERT), luaB__ALERT}, 640 {LUA_ALERT, luaB__ALERT},
641 {l_s(LUA_ERRORMESSAGE), luaB__ERRORMESSAGE}, 641 {LUA_ERRORMESSAGE, luaB__ERRORMESSAGE},
642 {l_s("call"), luaB_call}, 642 {l_s("call"), luaB_call},
643 {l_s("collectgarbage"), luaB_collectgarbage}, 643 {l_s("collectgarbage"), luaB_collectgarbage},
644 {l_s("copytagmethods"), luaB_copytagmethods}, 644 {l_s("copytagmethods"), luaB_copytagmethods},
@@ -678,7 +678,7 @@ static const luaL_reg base_funcs[] = {
678 678
679LUALIB_API void lua_baselibopen (lua_State *L) { 679LUALIB_API void lua_baselibopen (lua_State *L) {
680 luaL_openl(L, base_funcs); 680 luaL_openl(L, base_funcs);
681 lua_pushliteral(L, l_s(LUA_VERSION)); 681 lua_pushliteral(L, LUA_VERSION);
682 lua_setglobal(L, l_s("_VERSION")); 682 lua_setglobal(L, l_s("_VERSION"));
683 deprecated_funcs(L); 683 deprecated_funcs(L);
684} 684}