mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
C is not C++...
This commit is contained in:
parent
630acb2048
commit
e3cddc950c
4
liolib.c
4
liolib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: liolib.c,v 2.7 2002/06/05 17:24:04 roberto Exp roberto $
|
** $Id: liolib.c,v 2.8 2002/06/05 17:42:03 roberto Exp roberto $
|
||||||
** Standard I/O (and system) library
|
** Standard I/O (and system) library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -99,12 +99,12 @@ static int setnewfile (lua_State *L, FILE *f) {
|
|||||||
|
|
||||||
static int io_close (lua_State *L) {
|
static int io_close (lua_State *L) {
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
int status = 1;
|
||||||
if (lua_isnone(L, 1)) {
|
if (lua_isnone(L, 1)) {
|
||||||
lua_pushstring(L, IO_OUTPUT);
|
lua_pushstring(L, IO_OUTPUT);
|
||||||
lua_rawget(L, lua_upvalueindex(1));
|
lua_rawget(L, lua_upvalueindex(1));
|
||||||
}
|
}
|
||||||
f = tofile(L, 1);
|
f = tofile(L, 1);
|
||||||
int status = 1;
|
|
||||||
if (f != stdin && f != stdout && f != stderr) {
|
if (f != stdin && f != stdout && f != stderr) {
|
||||||
lua_settop(L, 1); /* make sure file is on top */
|
lua_settop(L, 1); /* make sure file is on top */
|
||||||
lua_pushliteral(L, CLOSEDFILEHANDLE);
|
lua_pushliteral(L, CLOSEDFILEHANDLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user