aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-11-18 11:48:44 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-11-18 11:48:44 -0200
commitd59c52753fd213f27021411a1e79c15fb4e3a979 (patch)
tree25cd5176bb00016bfede160e37886b58ab832ade
parent62e1a4c84d9075e27e5bcde20151f8545f9ab731 (diff)
downloadlua-d59c52753fd213f27021411a1e79c15fb4e3a979.tar.gz
lua-d59c52753fd213f27021411a1e79c15fb4e3a979.tar.bz2
lua-d59c52753fd213f27021411a1e79c15fb4e3a979.zip
undump needs file in binary mode
-rw-r--r--opcode.c6
1 files 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 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.75 1996/09/24 17:30:28 roberto Exp roberto $"; 6char *rcs_opcode="$Id: opcode.c,v 3.76 1996/09/24 21:46:44 roberto Exp roberto $";
7 7
8#include <setjmp.h> 8#include <setjmp.h>
9#include <stdio.h> 9#include <stdio.h>
@@ -548,8 +548,10 @@ int lua_dofile (char *filename)
548 return 2; 548 return 2;
549 c = fgetc(f); 549 c = fgetc(f);
550 ungetc(c, f); 550 ungetc(c, f);
551 if (c == ID_CHUNK) 551 if (c == ID_CHUNK) {
552 f = freopen(filename, "rb", f); /* set binary mode */
552 status = luaI_undump(f); 553 status = luaI_undump(f);
554 }
553 else { 555 else {
554 if (c == '#') 556 if (c == '#')
555 while ((c=fgetc(f)) != '\n') /* skip first line */; 557 while ((c=fgetc(f)) != '\n') /* skip first line */;