aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-19 18:18:02 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-19 18:18:02 -0200
commitf529a22ca5571644d94d10e0c478741baeffaf0c (patch)
treec0371934da51b274acea789cdf3a36f20783235e
parent783ba75129543eeeab1fda5eec2e6df63031cf23 (diff)
downloadlua-f529a22ca5571644d94d10e0c478741baeffaf0c.tar.gz
lua-f529a22ca5571644d94d10e0c478741baeffaf0c.tar.bz2
lua-f529a22ca5571644d94d10e0c478741baeffaf0c.zip
BUG: wrong line number (+1) in error report when file starts with "#..."
-rw-r--r--llex.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/llex.c b/llex.c
index 3e647b10..5c73c90a 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 1.12 1997/12/22 17:52:20 roberto Exp roberto $ 2** $Id: llex.c,v 1.13 1998/01/09 14:44:55 roberto Exp roberto $
3** Lexical Analizer 3** Lexical Analizer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -50,10 +50,8 @@ void luaX_init (void)
50static void firstline (LexState *LS) 50static void firstline (LexState *LS)
51{ 51{
52 int c = zgetc(LS->lex_z); 52 int c = zgetc(LS->lex_z);
53 if (c == '#') { 53 if (c == '#')
54 LS->linenumber++;
55 while ((c=zgetc(LS->lex_z)) != '\n' && c != EOZ) /* skip first line */; 54 while ((c=zgetc(LS->lex_z)) != '\n' && c != EOZ) /* skip first line */;
56 }
57 zungetc(LS->lex_z); 55 zungetc(LS->lex_z);
58} 56}
59 57