summaryrefslogtreecommitdiff
path: root/Source/cmListFileCache.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <bartosz.kosiorek@tomtom.com>2019-05-30 09:18:16 +0200
committerBrad King <brad.king@kitware.com>2019-06-03 10:03:53 -0400
commit3475e2728bad16899b50131785a61f43083e8ba9 (patch)
treea5068cc18e7e94fec5b03844da01edf88ec5542b /Source/cmListFileCache.cxx
parent187928875d215df8757b291ad629a36df75da42b (diff)
downloadcmake-3475e2728bad16899b50131785a61f43083e8ba9.tar.gz
cmListFileCache: When missing ending ) print starting line instead of last one
Fixes: #19301
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r--Source/cmListFileCache.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index f99caed69b..df0d00c592 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -192,12 +192,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
}
// Arguments.
- unsigned long lastLine;
unsigned long parenDepth = 0;
this->Separation = SeparationOkay;
- while (
- (static_cast<void>(lastLine = cmListFileLexer_GetCurrentLine(this->Lexer)),
- token = cmListFileLexer_Scan(this->Lexer))) {
+ while ((token = cmListFileLexer_Scan(this->Lexer))) {
if (token->type == cmListFileLexer_Token_Space ||
token->type == cmListFileLexer_Token_Newline) {
this->Separation = SeparationOkay;
@@ -252,7 +249,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
std::ostringstream error;
cmListFileContext lfc;
lfc.FilePath = this->FileName;
- lfc.Line = lastLine;
+ lfc.Line = line;
cmListFileBacktrace lfbt = this->Backtrace;
lfbt = lfbt.Push(lfc);
error << "Parse error. Function missing ending \")\". "