Browse Source

discard whitespace-only lines

master
n0m1s 6 years ago
parent
commit
686cfc1225
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      settings.cpp

+ 5
- 1
settings.cpp View File

@ -82,14 +82,18 @@ Settings const* Settings::load(char const* settings_filename)
//trim whitespace at beginning of line //trim whitespace at beginning of line
if(is_whitespace(c)) continue; if(is_whitespace(c)) continue;
//discard whitespace-only lines
if(c == '\n') continue;
first_char_of_line = false; first_char_of_line = false;
//check if comment, section or normal line
//is it a comment line?
if(c == ';') if(c == ';')
{ {
is_comment_line = true; is_comment_line = true;
continue; continue;
} }
//is it a section line?
else if (c == '[') else if (c == '[')
{ {
is_section_line = true; is_section_line = true;


Loading…
Cancel
Save