src/lib/INIReader.cpp
branchv_0
changeset 35 930f17f16fd7
parent 34 7eb3dcacba7b
child 39 509e4b02f3c2
--- a/src/lib/INIReader.cpp	Tue Sep 21 21:02:43 2021 +0200
+++ b/src/lib/INIReader.cpp	Wed Sep 29 00:54:55 2021 +0200
@@ -202,8 +202,19 @@
 	std::string readUntil(const std::string& until, bool* found = nullptr) {
 		std::stringstream result;
 
-		for (char ch = peek(); input.good() && !oneOf(ch, until); ch = peek()) {
-			if (allowLineContinuationsWithEscaping && ch == '\\') {
+		for (char ch = peek(); input.good(); ch = peek()) {
+			if (allowLineContinuationsWithSpace && ch == '\n') {
+				get();
+				ch = peek();
+				if (ch == ' ') get();
+				else if (ch == std::istream::traits_type::eof()) break;
+				else {
+					if (found) *found = true;
+					return result.str();
+				}
+			} else if (oneOf(ch, until)) {
+				break;
+			} else if (allowLineContinuationsWithEscaping && ch == '\\') {
 				get();
 				ch = get();
 				if (oneOf(ch, until) && ch == '\n') processContinuingLine(result);