aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua.c b/lua.c
index 9d347d75..d109acbf 100644
--- a/lua.c
+++ b/lua.c
@@ -115,12 +115,13 @@ static void l_message (const char *pname, const char *msg) {
115 115
116/* 116/*
117** Check whether 'status' is not OK and, if so, prints the error 117** Check whether 'status' is not OK and, if so, prints the error
118** message on the top of the stack. It assumes that the error object 118** message on the top of the stack.
119** is a string, as it was either generated by Lua or by 'msghandler'.
120*/ 119*/
121static int report (lua_State *L, int status) { 120static int report (lua_State *L, int status) {
122 if (status != LUA_OK) { 121 if (status != LUA_OK) {
123 const char *msg = lua_tostring(L, -1); 122 const char *msg = lua_tostring(L, -1);
123 if (msg == NULL)
124 msg = "(error message not a string)";
124 l_message(progname, msg); 125 l_message(progname, msg);
125 lua_pop(L, 1); /* remove message */ 126 lua_pop(L, 1); /* remove message */
126 } 127 }