aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-10-09 13:46:43 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-10-09 13:46:43 -0200
commit46b543ebef302ddb70cee59bb47ca542828de1d2 (patch)
treed18b1bd072a679d0805e5b75349a5a3596bc27b4 /lua.c
parent79909a92e194ccf4bf34e045993b88c89154f3ad (diff)
downloadlua-46b543ebef302ddb70cee59bb47ca542828de1d2.tar.gz
lua-46b543ebef302ddb70cee59bb47ca542828de1d2.tar.bz2
lua-46b543ebef302ddb70cee59bb47ca542828de1d2.zip
better treatment for errors inside _ERRORMETHOD
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua.c b/lua.c
index c5229f76..af599ffa 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.51 2000/09/11 19:42:57 roberto Exp roberto $ 2** $Id: lua.c,v 1.52 2000/09/25 16:15:52 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*/
@@ -91,10 +91,12 @@ static int ldo (int (*f)(lua_State *l, const char *), const char *name) {
91 res = f(L, name); /* dostring | dofile */ 91 res = f(L, name); /* dostring | dofile */
92 lua_settop(L, top); /* remove eventual results */ 92 lua_settop(L, top); /* remove eventual results */
93 signal(SIGINT, h); /* restore old action */ 93 signal(SIGINT, h); /* restore old action */
94 /* Lua gives no message in such cases, so lua.c provides one */
94 if (res == LUA_ERRMEM) { 95 if (res == LUA_ERRMEM) {
95 /* Lua gives no message in such case, so lua.c provides one */
96 fprintf(stderr, "lua: memory allocation error\n"); 96 fprintf(stderr, "lua: memory allocation error\n");
97 } 97 }
98 else if (res == LUA_ERRERR)
99 fprintf(stderr, "lua: error in error message\n");
98 return res; 100 return res;
99} 101}
100 102