| 283 | |
| 284 | |
| 285 | LUALIB_API int luaL_execresult (lua_State *L, int stat) { |
| 286 | const char *what = "exit"; /* type of termination */ |
| 287 | if (stat == -1) /* error? */ |
| 288 | return luaL_fileresult(L, 0, NULL); |
| 289 | else { |
| 290 | l_inspectstat(stat, what); /* interpret result */ |
| 291 | if (*what == 'e' && stat == 0) /* successful termination? */ |
| 292 | lua_pushboolean(L, 1); |
| 293 | else |
| 294 | luaL_pushfail(L); |
| 295 | lua_pushstring(L, what); |
| 296 | lua_pushinteger(L, stat); |
| 297 | return 3; /* return true/fail,what,code */ |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | /* }====================================================== */ |
| 302 |
no test coverage detected