From 52ee91dd73199e068d31d3ac138d933ddd4fb9b1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 22 Feb 2001 14:15:18 -0300 Subject: better encapsulation of some types --- ldo.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ldo.c') diff --git a/ldo.c b/ldo.c index 36304fb7..7ab130af 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 1.123 2001/02/07 18:13:49 roberto Exp roberto $ +** $Id: ldo.c,v 1.124 2001/02/20 18:15:33 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -265,12 +265,9 @@ static int parse_file (lua_State *L, const char *filename) { ZIO z; int status; int bin; /* flag for file mode */ - int c; /* look ahead char */ FILE *f = (filename == NULL) ? stdin : fopen(filename, "r"); if (f == NULL) return LUA_ERRFILE; /* unable to open file */ - c = fgetc(f); - ungetc(c, f); - bin = (c == ID_CHUNK); + bin = (ungetc(fgetc(f), f) == ID_CHUNK); if (bin && f != stdin) { fclose(f); f = fopen(filename, "rb"); /* reopen in binary mode */ -- cgit v1.2.3-55-g6feb