| 759 | |
| 760 | |
| 761 | static int errfile (lua_State *L, const char *what, int fnameindex) { |
| 762 | int err = errno; |
| 763 | const char *filename = lua_tostring(L, fnameindex) + 1; |
| 764 | if (err != 0) |
| 765 | lua_pushfstring(L, "cannot %s %s: %s", what, filename, strerror(err)); |
| 766 | else |
| 767 | lua_pushfstring(L, "cannot %s %s", what, filename); |
| 768 | lua_remove(L, fnameindex); |
| 769 | return LUA_ERRFILE; |
| 770 | } |
| 771 | |
| 772 | |
| 773 | /* |
no test coverage detected