fixed the lineno error when using the new sdcpp
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 10 Aug 2001 10:37:49 +0000 (10:37 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 10 Aug 2001 10:37:49 +0000 (10:37 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1136 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCC.lex

index 92061f169ad503d380e5e4d61083acfd4329764d..425508adf254f00083980e12c0973535eb8ab641 100644 (file)
@@ -281,8 +281,8 @@ int checkCurrFile ( char *s)
     /* set the current line number to   */
     /* line number if printFlag is on   */
     if (!*s) {         
-       yylineno = lNum ;
-       return 0;
+      lineno = yylineno = lNum ;
+      return 0;
     }
     
     /* if we have a filename then check */
@@ -291,8 +291,8 @@ int checkCurrFile ( char *s)
     s++ ;
 
     if ( strncmp(s,fullSrcFileName,strlen(fullSrcFileName)) == 0) {
-           yylineno = lNum - 2;                                        
-           currFname = fullSrcFileName ;
+      lineno = yylineno = lNum;                                        
+      currFname = fullSrcFileName ;
     }  else {
        char *sb = s;
        /* mark the end of the filename */
@@ -300,7 +300,7 @@ int checkCurrFile ( char *s)
        *s = '\0';
        currFname = Safe_calloc(1,strlen(sb)+1);
        strcpy(currFname,sb);
-       yylineno = lNum - 2;
+       lineno = yylineno = lNum;
     }
     filename = currFname ;
     return 0;