From 781181461f8f2168e9a00e29bd2307342766640c Mon Sep 17 00:00:00 2001 From: David Schneller Date: Wed, 27 Dec 2023 21:37:21 +0100 Subject: [PATCH] Fix GMSH files with Windows line endings --- src/third_party/GMSHLexer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/third_party/GMSHLexer.cpp b/src/third_party/GMSHLexer.cpp index ee400fe..d56fb93 100644 --- a/src/third_party/GMSHLexer.cpp +++ b/src/third_party/GMSHLexer.cpp @@ -23,9 +23,12 @@ GMSHToken GMSHLexer::getToken() { return GMSHToken::eof; } - while (isspace(lastChar)) { + while (isspace(lastChar) && in->good()) { advance(); } + if (!in->good()) { + return GMSHToken::eof; + } if (lastChar == '$') { advance();