aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-07-12 16:34:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-07-12 16:34:03 -0300
commit9f25df02d53f6d31d904957bc411ef72d8378dc8 (patch)
treef03105ea6d9bc5f6c9ac0ebeff6d3a3f48479637 /ldo.c
parentae1cf64348ca7bcb6d3abb19a0b97918e343914c (diff)
downloadlua-9f25df02d53f6d31d904957bc411ef72d8378dc8.tar.gz
lua-9f25df02d53f6d31d904957bc411ef72d8378dc8.tar.bz2
lua-9f25df02d53f6d31d904957bc411ef72d8378dc8.zip
new definition for headers of binary files
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ldo.c b/ldo.c
index c2d0e92d..874a22b8 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.135 2001/06/05 19:27:32 roberto Exp roberto $ 2** $Id: ldo.c,v 1.136 2001/06/08 19:00:57 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) == ID_CHUNK); 246 bin = (ungetc(fgetc(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 */
@@ -269,7 +269,7 @@ LUA_API int lua_loadbuffer (lua_State *L, const l_char *buff, size_t size,
269 int status; 269 int status;
270 if (!name) name = l_s("?"); 270 if (!name) name = l_s("?");
271 luaZ_mopen(&z, buff, size, name); 271 luaZ_mopen(&z, buff, size, name);
272 status = protectedparser(L, &z, buff[0]==ID_CHUNK); 272 status = protectedparser(L, &z, buff[0]==LUA_SIGNATURE[0]);
273 return status; 273 return status;
274} 274}
275 275