From 325e516a638f381adb896a376f6fb1d0c8fa8f60 Mon Sep 17 00:00:00 2001 From: n0m1s Date: Sat, 11 Jan 2020 16:51:18 +0100 Subject: [PATCH] fix: call add_line only if normal line --- settings.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/settings.cpp b/settings.cpp index 997ba3c..54e212e 100644 --- a/settings.cpp +++ b/settings.cpp @@ -104,14 +104,15 @@ Settings const* Settings::load(char const* settings_filename) if(c == '\n') { + if(!is_comment_line && !is_section_line) + settings->add_line(current_section.to_string(), + current_key.to_string(), + current_val.to_string()); + first_char_of_line = true; is_comment_line = false; is_section_line = false; - settings->add_line(current_section.to_string(), - current_key.to_string(), - current_val.to_string()); - current_key.clear(); current_val.clear(); write_to_key = true;