| 232 | |
| 233 | |
| 234 | LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { |
| 235 | int en = errno; /* calls to Lua API may change this value */ |
| 236 | if (stat) { |
| 237 | lua_pushboolean(L, 1); |
| 238 | return 1; |
| 239 | } |
| 240 | else { |
| 241 | lua_pushnil(L); |
| 242 | if (fname) |
| 243 | lua_pushfstring(L, "%s: %s", fname, strerror(en)); |
| 244 | else |
| 245 | lua_pushstring(L, strerror(en)); |
| 246 | lua_pushinteger(L, en); |
| 247 | return 3; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | |
| 252 | #if !defined(l_inspectstat) /* { */ |
no test coverage detected