From 4d2de484f653fe46ac97fcb7e02f3cc7762cd962 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 16 Jun 1997 16:48:18 -0300 Subject: "lua_seterrormethod" should return the previous handler. --- lua.h | 4 ++-- opcode.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lua.h b/lua.h index e255045b..daa06f55 100644 --- a/lua.h +++ b/lua.h @@ -2,7 +2,7 @@ ** LUA - An Extensible Extension Language ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** e-mail: lua@tecgraf.puc-rio.br -** $Id: lua.h,v 4.6 1997/06/09 17:28:14 roberto Exp roberto $ +** $Id: lua.h,v 4.7 1997/06/12 18:27:29 roberto Exp roberto $ */ @@ -23,7 +23,7 @@ typedef unsigned int lua_Object; lua_Object lua_settagmethod (int tag, char *event, lua_CFunction method); lua_Object lua_gettagmethod (int tag, char *event); -void lua_seterrormethod (lua_CFunction method); +lua_Object lua_seterrormethod (lua_CFunction method); int lua_newtag (void); void lua_settag (int tag); /* In: object */ diff --git a/opcode.c b/opcode.c index 101819dc..8df64cae 100644 --- a/opcode.c +++ b/opcode.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 4.9 1997/06/16 16:50:22 roberto Exp roberto $"; +char *rcs_opcode="$Id: opcode.c,v 4.10 1997/06/16 18:42:32 roberto Exp roberto $"; #include #include @@ -667,10 +667,11 @@ lua_Object lua_settagmethod (int tag, char *event, lua_CFunction method) return put_luaObjectonTop(); } -void lua_seterrormethod (lua_CFunction method) +lua_Object lua_seterrormethod (lua_CFunction method) { lua_pushcfunction(method); - do_unprotectedrun(luaI_seterrormethod, 1, 0); + do_unprotectedrun(luaI_seterrormethod, 1, 1); + return put_luaObjectonTop(); } -- cgit v1.2.3-55-g6feb