Merge branch 'fix_archive_win_le' into 'master'

fix loading windows line ending files in textarchive

See merge request ngsolve/netgen!550
This commit is contained in:
Schöberl, Joachim 2023-01-19 17:57:15 +01:00
commit 4710d94fb7

View File

@ -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