From 9f25df02d53f6d31d904957bc411ef72d8378dc8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 12 Jul 2001 16:34:03 -0300 Subject: new definition for headers of binary files --- lundump.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lundump.c') diff --git a/lundump.c b/lundump.c index f365b577..0e09513c 100644 --- a/lundump.c +++ b/lundump.c @@ -165,8 +165,7 @@ static void LoadConstants (lua_State* L, Proto* f, ZIO* Z, int swap) n=LoadInt(L,Z,swap); f->p=luaM_newvector(L,n,Proto*); f->sizep=n; - for (i=0; ip[i]=LoadFunction(L,Z,swap); + for (i=0; ip[i]=LoadFunction(L,Z,swap); } static Proto* LoadFunction (lua_State* L, ZIO* Z, int swap) @@ -190,7 +189,7 @@ static Proto* LoadFunction (lua_State* L, ZIO* Z, int swap) static void LoadSignature (lua_State* L, ZIO* Z) { - const l_char* s=l_s(SIGNATURE); + const l_char* s=l_s(LUA_SIGNATURE); while (*s!=0 && ezgetc(L,Z)==*s) ++s; if (*s!=0) luaO_verror(L,l_s("bad signature in `%.99s'"),ZNAME(Z)); @@ -245,16 +244,11 @@ static Proto* LoadChunk (lua_State* L, ZIO* Z) /* ** load one chunk from a file or buffer -** return main if ok and NULL at EOF */ Proto* luaU_undump (lua_State* L, ZIO* Z) { - Proto* f=NULL; - int c=zgetc(Z); - if (c==ID_CHUNK) - f=LoadChunk(L,Z); - c=zgetc(Z); - if (c!=EOZ) + Proto* f=LoadChunk(L,Z); + if (zgetc(Z)!=EOZ) luaO_verror(L,l_s("`%.99s' apparently contains more than one chunk"),ZNAME(Z)); return f; } -- cgit v1.2.3-55-g6feb