From d59c52753fd213f27021411a1e79c15fb4e3a979 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 18 Nov 1996 11:48:44 -0200 Subject: undump needs file in binary mode --- opcode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opcode.c b/opcode.c index 567f6830..107024a4 100644 --- a/opcode.c +++ b/opcode.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 3.75 1996/09/24 17:30:28 roberto Exp roberto $"; +char *rcs_opcode="$Id: opcode.c,v 3.76 1996/09/24 21:46:44 roberto Exp roberto $"; #include #include @@ -548,8 +548,10 @@ int lua_dofile (char *filename) return 2; c = fgetc(f); ungetc(c, f); - if (c == ID_CHUNK) + if (c == ID_CHUNK) { + f = freopen(filename, "rb", f); /* set binary mode */ status = luaI_undump(f); + } else { if (c == '#') while ((c=fgetc(f)) != '\n') /* skip first line */; -- cgit v1.2.3-55-g6feb