From: Andrei Pavel Date: Mon, 4 Jan 2021 16:01:33 +0000 (+0200) Subject: [#1603] CSVFile: skip blank lines X-Git-Tag: Kea-1.9.4~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb27f66223cfdd0817b656134938504e5169af28;p=thirdparty%2Fkea.git [#1603] CSVFile: skip blank lines --- diff --git a/src/lib/util/csv_file.cc b/src/lib/util/csv_file.cc index 86cc6d0be8..1abf81db69 100644 --- a/src/lib/util/csv_file.cc +++ b/src/lib/util/csv_file.cc @@ -269,9 +269,11 @@ CSVFile::next(CSVRow& row, const bool skip_validation) { return (false); } - // Get exactly one line of the file. + // Get the next non-blank line from the file. std::string line; - std::getline(*fs_, line); + while (fs_->good() && line.empty()) { + std::getline(*fs_, line); + } // If we didn't read anything... if (line.empty()) {