Skip to content

Commit 6e6550d

Browse files
committed
Ignore rest of line after continuation char
1 parent e617b74 commit 6e6550d

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Common/src/CConfig.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,16 +2849,18 @@ void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) {
28492849
throw(1);
28502850
}
28512851

2852-
PrintingToolbox::trim(text_line);
2852+
PrintingToolbox::trim(text_line);
28532853

2854-
2855-
/*--- Check if there is a line continuation character at the end of the current line.
2856-
* If yes, read until there is a line without one or a comment. If there is a statement after a cont. char
2854+
/*--- Check if there is a line continuation character at the
2855+
* end of the current line or somewhere in between (the rest is ignored then).
2856+
* If yes, read until there is a line without one or an empty line.
2857+
* If there is a statement after a cont. char
28572858
* throw an error. ---*/
28582859

2859-
while (text_line.back() == '\\'){
2860+
while (text_line.back() == '\\' ||
2861+
(PrintingToolbox::split(text_line, '\\').size() > 1)){
28602862
string tmp;
2861-
getline (case_file, tmp);
2863+
getline (config_buffer, tmp);
28622864
line_count++;
28632865
if (tmp.find_first_of('=') != string::npos){
28642866
errorString.append("Line " + to_string(line_count) + ": Statement found after continuation character.\n");

0 commit comments

Comments
 (0)