Просмотр исходного кода

Skip blank lines while loading PreValue entries

SybexXx 1 день назад
Родитель
Сommit
61d6931a2c
1 измененных файлов с 10 добавлено и 5 удалено
  1. 10 5
      code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

+ 10 - 5
code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

@@ -223,14 +223,19 @@ bool ClassFlowPostProcessing::LoadPreValue(void) {
                 }
             }
 
-            if (fgets(zw, sizeof(zw), pFile.get()) == NULL) {
+            std::string nextLine;
+            bool haveNextLine = false;
+            while (fgets(zw, sizeof(zw), pFile.get()) != NULL) {
+                nextLine = trim(std::string(zw));
+                if (!nextLine.empty()) {
+                    haveNextLine = true;
+                    break;
+                }
+            }
+            if (!haveNextLine) {
                 break;
             }
 
-            const std::string nextLine = trim(std::string(zw));
-            if (nextLine.empty()) {
-                continue;
-            }
             ESP_LOGD(TAG, "Read line Prevalue.ini: %s", zw);
             splitted = HelperZerlegeZeile(nextLine, "\t");
         }