skipping of '#' in first line is done by lex.c.

This commit is contained in:
Roberto Ierusalimschy
1997-07-29 10:33:15 -03:00
parent 66be42549e
commit 11d97c34d5
2 changed files with 14 additions and 7 deletions

View File

@@ -5,7 +5,7 @@
** Also provides some predefined lua functions.
*/
char *rcs_inout="$Id: inout.c,v 2.69 1997/06/27 22:38:49 roberto Exp roberto $";
char *rcs_inout="$Id: inout.c,v 2.70 1997/07/07 21:05:51 roberto Exp roberto $";
#include <stdio.h>
#include <string.h>
@@ -71,12 +71,8 @@ int lua_dofile (char *filename)
f = freopen(filename, "rb", f); /* set binary mode */
status = lua_doFILE(f, 1);
}
else {
if (c == '#')
while ((c=fgetc(f)) != '\n' && c != 0) /* skip first line */;
ungetc(c, f);
else
status = lua_doFILE(f, 0);
}
if (f != stdin)
fclose(f);
return status;