From e86dab2daec444580485dcdba5f3f68d1474dad5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Jul 2005 11:01:28 -0300 Subject: details --- lauxlib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lauxlib.c b/lauxlib.c index 87d58ccc..9c8f050e 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.136 2005/05/31 14:31:50 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.137 2005/05/31 14:34:02 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -682,14 +682,15 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { static int panic (lua_State *L) { (void)L; /* to avoid warnings */ - fprintf(stderr, "PANIC: unprotected error during Lua-API call\n"); + fprintf(stderr, "PANIC: unprotected error during Lua-API call (%s)\n", + lua_tostring(L, -1)); return 0; } LUALIB_API lua_State *luaL_newstate (void) { lua_State *L = lua_newstate(l_alloc, NULL); - lua_atpanic(L, &panic); + if (L) lua_atpanic(L, &panic); return L; } -- cgit v1.2.3-55-g6feb