aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-07-16 17:24:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-07-16 17:24:48 -0300
commit6c8e652aa6b5bf7018ff74473a6ef5bb58e4890e (patch)
tree343aabce9645ac52904ebdff4d5ab0727f360296 /ldo.c
parent9f25df02d53f6d31d904957bc411ef72d8378dc8 (diff)
downloadlua-6c8e652aa6b5bf7018ff74473a6ef5bb58e4890e.tar.gz
lua-6c8e652aa6b5bf7018ff74473a6ef5bb58e4890e.tar.bz2
lua-6c8e652aa6b5bf7018ff74473a6ef5bb58e4890e.zip
use macros for 'getc'
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldo.c b/ldo.c
index 874a22b8..ceda04d9 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.136 2001/06/08 19:00:57 roberto Exp roberto $ 2** $Id: ldo.c,v 1.137 2001/07/12 19:34:03 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -243,7 +243,7 @@ LUA_API int lua_loadfile (lua_State *L, const l_char *filename) {
243 int nlevel; /* level on the stack of filename */ 243 int nlevel; /* level on the stack of filename */
244 FILE *f = (filename == NULL) ? stdin : fopen(filename, l_s("r")); 244 FILE *f = (filename == NULL) ? stdin : fopen(filename, l_s("r"));
245 if (f == NULL) return LUA_ERRFILE; /* unable to open file */ 245 if (f == NULL) return LUA_ERRFILE; /* unable to open file */
246 bin = (ungetc(fgetc(f), f) == LUA_SIGNATURE[0]); 246 bin = (ungetc(getc(f), f) == LUA_SIGNATURE[0]);
247 if (bin && f != stdin) { 247 if (bin && f != stdin) {
248 fclose(f); 248 fclose(f);
249 f = fopen(filename, l_s("rb")); /* reopen in binary mode */ 249 f = fopen(filename, l_s("rb")); /* reopen in binary mode */