mirror of https://github.com/rusefi/lua.git
more robust when printing error messages
This commit is contained in:
parent
e572dffa15
commit
b449a5e574
13
lua.c
13
lua.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lua.c,v 1.91 2002/06/18 17:12:05 roberto Exp roberto $
|
** $Id: lua.c,v 1.92 2002/06/18 17:43:49 roberto Exp roberto $
|
||||||
** Lua stand-alone interpreter
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -73,9 +73,14 @@ static void report (int status) {
|
||||||
lua_remove(L, -2); /* lease only traceback on stack */
|
lua_remove(L, -2); /* lease only traceback on stack */
|
||||||
}
|
}
|
||||||
lua_getglobal(L, "_ALERT");
|
lua_getglobal(L, "_ALERT");
|
||||||
lua_pushvalue(L, -2);
|
if (lua_isfunction(L, -1)) {
|
||||||
lua_pcall(L, 1, 0);
|
lua_pushvalue(L, -2);
|
||||||
lua_pop(L, 1);
|
lua_pcall(L, 1, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lua_pop(L, 1);
|
||||||
|
fprintf(stderr, "%s", lua_tostring(L, -1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue