diff options
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index b1cd889..929b1cd 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -9,14 +9,14 @@ #include "cmSystemTools.h" #include "cmake.h" +#include "cmConfigure.h" #include <algorithm> #include <assert.h> -#include <cmConfigure.h> #include <sstream> struct cmListFileParser { - cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt, + cmListFileParser(cmListFile* lf, cmListFileBacktrace const& lfbt, cmMessenger* messenger, const char* filename); ~cmListFileParser(); void IssueFileOpenError(std::string const& text) const; @@ -39,7 +39,8 @@ struct cmListFileParser } Separation; }; -cmListFileParser::cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt, +cmListFileParser::cmListFileParser(cmListFile* lf, + cmListFileBacktrace const& lfbt, cmMessenger* messenger, const char* filename) : ListFile(lf) @@ -80,6 +81,13 @@ bool cmListFileParser::ParseFile() return false; } + if (bom == cmListFileLexer_BOM_Broken) { + cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR); + this->IssueFileOpenError("Error while reading Byte-Order-Mark. " + "File not seekable?"); + return false; + } + // Verify the Byte-Order-Mark, if any. if (bom != cmListFileLexer_BOM_None && bom != cmListFileLexer_BOM_UTF8) { cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR); |