فهرست منبع

BUG: wrong line number (+1) in error report when file starts with "#..."

Roberto Ierusalimschy 27 سال پیش
والد
کامیت
f529a22ca5
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      llex.c

+ 2 - 4
llex.c

@@ -1,5 +1,5 @@
 /*
-** $Id: llex.c,v 1.12 1997/12/22 17:52:20 roberto Exp roberto $
+** $Id: llex.c,v 1.13 1998/01/09 14:44:55 roberto Exp roberto $
 ** Lexical Analizer
 ** See Copyright Notice in lua.h
 */
@@ -50,10 +50,8 @@ void luaX_init (void)
 static void firstline (LexState *LS)
 {
   int c = zgetc(LS->lex_z);
-  if (c == '#') {
-    LS->linenumber++;
+  if (c == '#')
     while ((c=zgetc(LS->lex_z)) != '\n' && c != EOZ) /* skip first line */;
-  }
   zungetc(LS->lex_z);
 }