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