summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-04 12:27:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-06-04 12:28:09 (GMT)
commit99b9b01c020a0b20c0eefa73a39138471c01a053 (patch)
tree66959889b55fcfa2dece3c655775145e1fe5666a /Source
parente591e22d4c7d2b4d4806cf47923e54269644b2a2 (diff)
parent3475e2728bad16899b50131785a61f43083e8ba9 (diff)
downloadCMake-99b9b01c020a0b20c0eefa73a39138471c01a053.zip
CMake-99b9b01c020a0b20c0eefa73a39138471c01a053.tar.gz
CMake-99b9b01c020a0b20c0eefa73a39138471c01a053.tar.bz2
Merge topic 'print-correct-line-number'
3475e2728b cmListFileCache: When missing ending ) print starting line instead of last one Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3398
Diffstat (limited to 'Source')
-rw-r--r--Source/cmListFileCache.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index f99caed..df0d00c 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 \")\". "