** When creating file handles, always creates a `closed' file handle ** before opening the actual file; so, if there is a memory error, the ** file is not left opened. */
| 11998 | ** file is not left opened. |
| 11999 | */ |
| 12000 | static FILE **newfile (lua_State *L) { |
| 12001 | FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); |
| 12002 | *pf = NULL; /* file handle is currently `closed' */ |
| 12003 | luaL_getmetatable(L, LUA_FILEHANDLE); |
| 12004 | lua_setmetatable(L, -2); |
| 12005 | return pf; |
| 12006 | } |
| 12007 | |
| 12008 | |
| 12009 | /* |
no test coverage detected