diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-11-18 11:48:44 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-11-18 11:48:44 -0200 |
commit | d59c52753fd213f27021411a1e79c15fb4e3a979 (patch) | |
tree | 25cd5176bb00016bfede160e37886b58ab832ade | |
parent | 62e1a4c84d9075e27e5bcde20151f8545f9ab731 (diff) | |
download | lua-d59c52753fd213f27021411a1e79c15fb4e3a979.tar.gz lua-d59c52753fd213f27021411a1e79c15fb4e3a979.tar.bz2 lua-d59c52753fd213f27021411a1e79c15fb4e3a979.zip |
undump needs file in binary mode
-rw-r--r-- | opcode.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.75 1996/09/24 17:30:28 roberto Exp roberto $"; | 6 | char *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 */; |