From e6d132830a9431f23681ff677460c37bfacfd4f6 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 9 Aug 1988 14:07:39 +0000 Subject: [PATCH] fix: line number administration wrong in scan.c --- lang/cem/cemcom/Makefile | 1 + lang/cem/cemcom/scan.c | 3 +++ util/cpp/Makefile | 1 + util/cpp/scan.c | 3 +++ 4 files changed, 8 insertions(+) diff --git a/lang/cem/cemcom/Makefile b/lang/cem/cemcom/Makefile index 9d55f3dea..20f61dcf2 100644 --- a/lang/cem/cemcom/Makefile +++ b/lang/cem/cemcom/Makefile @@ -586,6 +586,7 @@ options.o: spec_arith.h options.o: target_sizes.h options.o: use_tmp.h scan.o: class.h +scan.o: file_info.h scan.o: idf.h scan.o: input.h scan.o: interface.h diff --git a/lang/cem/cemcom/scan.c b/lang/cem/cemcom/scan.c index da83648fa..b23a0e02b 100644 --- a/lang/cem/cemcom/scan.c +++ b/lang/cem/cemcom/scan.c @@ -21,6 +21,7 @@ #include "idf.h" #include "macro.h" #include "interface.h" +#include "file_info.h" #define EOS '\0' #define overflow() (fatal("actual parameter buffer overflow")) @@ -141,6 +142,7 @@ copyact(ch1, ch2, level) #endif __MATCHING_PAR__ case '\n': + LineNumber++; while (LoadChar(ch), ch == '#') { /* This piece of code needs some explanation: consider the call of @@ -208,6 +210,7 @@ copyact(ch1, ch2, level) else if (ch == '\n') { lexerror("newline in string"); + LineNumber++; copy(match); break; } diff --git a/util/cpp/Makefile b/util/cpp/Makefile index da7b1566a..5b0c4d66a 100644 --- a/util/cpp/Makefile +++ b/util/cpp/Makefile @@ -223,6 +223,7 @@ replace.o: pathlength.h replace.o: textsize.h scan.o: charoffset.h scan.o: class.h +scan.o: file_info.h scan.o: idf.h scan.o: input.h scan.o: inputtype.h diff --git a/util/cpp/scan.c b/util/cpp/scan.c index e99602475..677f3a0c4 100644 --- a/util/cpp/scan.c +++ b/util/cpp/scan.c @@ -18,6 +18,7 @@ #include "idf.h" #include "macro.h" #include "interface.h" +#include "file_info.h" #define EOS '\0' #define overflow() (fatal("actual parameter buffer overflow")) @@ -138,6 +139,7 @@ copyact(ch1, ch2, level) #endif __MATCHING_PAR__ case '\n': + LineNumber++; LoadChar(ch); while (ch == '#') { /* This piece of code needs some @@ -207,6 +209,7 @@ copyact(ch1, ch2, level) } else if (ch == '\n') { + LineNumber++; error("newline in string"); copy(match); break; -- 2.34.1