diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-07-29 10:33:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-07-29 10:33:15 -0300 |
commit | 11d97c34d5e3d5e45e3e6ffd12effe95d6f483cc (patch) | |
tree | 71ad9881572f476fb8650fbae2201c26e442943d /inout.c | |
parent | 66be42549e5eb5f25de6b8cbfee8a064b914cbb0 (diff) | |
download | lua-11d97c34d5e3d5e45e3e6ffd12effe95d6f483cc.tar.gz lua-11d97c34d5e3d5e45e3e6ffd12effe95d6f483cc.tar.bz2 lua-11d97c34d5e3d5e45e3e6ffd12effe95d6f483cc.zip |
skipping of '#' in first line is done by lex.c.
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.69 1997/06/27 22:38:49 roberto Exp roberto $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.70 1997/07/07 21:05:51 roberto Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <string.h> | 11 | #include <string.h> |
@@ -71,12 +71,8 @@ int lua_dofile (char *filename) | |||
71 | f = freopen(filename, "rb", f); /* set binary mode */ | 71 | f = freopen(filename, "rb", f); /* set binary mode */ |
72 | status = lua_doFILE(f, 1); | 72 | status = lua_doFILE(f, 1); |
73 | } | 73 | } |
74 | else { | 74 | else |
75 | if (c == '#') | ||
76 | while ((c=fgetc(f)) != '\n' && c != 0) /* skip first line */; | ||
77 | ungetc(c, f); | ||
78 | status = lua_doFILE(f, 0); | 75 | status = lua_doFILE(f, 0); |
79 | } | ||
80 | if (f != stdin) | 76 | if (f != stdin) |
81 | fclose(f); | 77 | fclose(f); |
82 | return status; | 78 | return status; |