diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-07-07 18:05:51 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-07-07 18:05:51 -0300 |
commit | 66be42549e5eb5f25de6b8cbfee8a064b914cbb0 (patch) | |
tree | 86b005c4cfdf64999b4643cdee32a4bb94c5340e | |
parent | 067db30d715c999c3a5f6cb2da3cc7e863732603 (diff) | |
download | lua-github-66be42549e5eb5f25de6b8cbfee8a064b914cbb0.tar.gz |
BUG: files starting with '#' get wrong line numbers
-rw-r--r-- | inout.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5,7 +5,7 @@ ** Also provides some predefined lua functions. */ -char *rcs_inout="$Id: inout.c,v 2.68 1997/06/26 20:47:43 roberto Exp roberto $"; +char *rcs_inout="$Id: inout.c,v 2.69 1997/06/27 22:38:49 roberto Exp roberto $"; #include <stdio.h> #include <string.h> @@ -73,7 +73,8 @@ int lua_dofile (char *filename) } else { if (c == '#') - while ((c=fgetc(f)) != '\n') /* skip first line */; + while ((c=fgetc(f)) != '\n' && c != 0) /* skip first line */; + ungetc(c, f); status = lua_doFILE(f, 0); } if (f != stdin) |