]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1603] CSVFile: skip blank lines
authorAndrei Pavel <andrei@isc.org>
Mon, 4 Jan 2021 16:01:33 +0000 (18:01 +0200)
committerAndrei Pavel <andrei@isc.org>
Mon, 4 Jan 2021 17:43:53 +0000 (17:43 +0000)
src/lib/util/csv_file.cc

index 86cc6d0be8935b6fc9d3022d1679cb9118b43a72..1abf81db69c50156df7a274b5f94a80b4a02d585 100644 (file)
@@ -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()) {