Skip to content
Snippets Groups Projects
Verified Commit 8c83d3e7 authored by Xavier Robin's avatar Xavier Robin
Browse files

fix: SCHWED-5481 handle SDF files with CRLF endings

parent 10f8ab9d
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,13 @@ void SDFReader::Import(mol::EntityHandle& ent)
while (std::getline(instream_,line)) {
++line_num;
// std::getline removes EOL character but may leave a DOS CR (\r) in Unix
size_t cr_pos = line.find("\r");
if (cr_pos != String::npos) {
LOG_TRACE( "Remove CR@" << cr_pos);
line.erase(cr_pos);
}
if (line_num<=4) {
ParseAndAddHeader(line, line_num, ent, editor);
} else if (line_num<=atom_count_+4) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment