diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-01-19 18:18:02 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-01-19 18:18:02 -0200 |
| commit | f529a22ca5571644d94d10e0c478741baeffaf0c (patch) | |
| tree | c0371934da51b274acea789cdf3a36f20783235e /llex.c | |
| parent | 783ba75129543eeeab1fda5eec2e6df63031cf23 (diff) | |
| download | lua-f529a22ca5571644d94d10e0c478741baeffaf0c.tar.gz lua-f529a22ca5571644d94d10e0c478741baeffaf0c.tar.bz2 lua-f529a22ca5571644d94d10e0c478741baeffaf0c.zip | |
BUG: wrong line number (+1) in error report when file starts with "#..."
Diffstat (limited to 'llex.c')
| -rw-r--r-- | llex.c | 6 |
1 files changed, 2 insertions, 4 deletions
| @@ -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) | |||
| 50 | static void firstline (LexState *LS) | 50 | static 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 | ||
