** Check whether 'status' is not OK and, if so, prints the error ** message on the top of the stack. */
| 118 | ** message on the top of the stack. |
| 119 | */ |
| 120 | static int report (lua_State *L, int status) { |
| 121 | if (status != LUA_OK) { |
| 122 | const char *msg = lua_tostring(L, -1); |
| 123 | if (msg == NULL) |
| 124 | msg = "(error message not a string)"; |
| 125 | l_message(progname, msg); |
| 126 | lua_pop(L, 1); /* remove message */ |
| 127 | } |
| 128 | return status; |
| 129 | } |
| 130 | |
| 131 | |
| 132 | /* |
no test coverage detected