mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
fix loading windows line ending files in textarchive
This commit is contained in:
parent
2f4e52594e
commit
8745a12246
@ -987,6 +987,8 @@ namespace ngcore
|
||||
*stream >> len;
|
||||
char ch;
|
||||
stream->get(ch); // '\n'
|
||||
if(ch == '\r') // windows line endings -> read \n as well
|
||||
stream->get(ch);
|
||||
str.resize(len);
|
||||
if(len)
|
||||
stream->get(&str[0], len+1, '\0');
|
||||
@ -1006,6 +1008,8 @@ namespace ngcore
|
||||
if(len)
|
||||
{
|
||||
stream->get(ch); // \n
|
||||
if(ch == '\r') // windows line endings, read \n as well
|
||||
stream->get(ch);
|
||||
stream->get(&str[0], len+1, '\0'); // NOLINT
|
||||
}
|
||||
str[len] = '\0'; // NOLINT
|
||||
|
Loading…
Reference in New Issue
Block a user