| 735 | |
| 736 | |
| 737 | static int errfile (lua_State *L, const char *what, int fnameindex) { |
| 738 | int err = errno; |
| 739 | const char *filename = lua_tostring(L, fnameindex) + 1; |
| 740 | if (err != 0) |
| 741 | lua_pushfstring(L, "cannot %s %s: %s", what, filename, strerror(err)); |
| 742 | else |
| 743 | lua_pushfstring(L, "cannot %s %s", what, filename); |
| 744 | lua_remove(L, fnameindex); |
| 745 | return LUA_ERRFILE; |
| 746 | } |
| 747 | |
| 748 | |
| 749 | /* |
no test coverage detected