From 3f3d25d9c7fa38c7c890a3fa3ff084393795adfe Mon Sep 17 00:00:00 2001 From: 3lswear Date: Sat, 12 Feb 2022 02:13:00 +0300 Subject: [PATCH] feat: skip newlines --- src/config/Tokenizer.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/config/Tokenizer.cpp b/src/config/Tokenizer.cpp index 0ff9bdb..903cfc2 100644 --- a/src/config/Tokenizer.cpp +++ b/src/config/Tokenizer.cpp @@ -134,26 +134,16 @@ namespace config { token.type = NEWLINE; - std::streampos prev_pos; - file.get(c); - if (c != '\n') - { - file.seekg(-1, std::ios_base::cur); - } - else if (file.eof()) + do + file.get(c); + while (c == '\n' && !file.eof()); + if (file.eof()) { file.clear(); DBOUT << "cleared" <