From a2bde4a0f04f7094dec23b2c69a281114dc5be7b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 9 Feb 2023 23:32:39 +0100 Subject: [PATCH] correct check for CRLF old attempt tried to look only at forst occurence of LF but reported CRLF also for LF endings. --- src/IO.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IO.f90 b/src/IO.f90 index c83ea1a22..b7bd5e982 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -136,8 +136,8 @@ function IO_read(fileName) result(fileContent) if (myStat /= 0) call IO_error(102,trim(fileName)) close(fileUnit) - if (scan(fileContent(:index(fileContent,LF)),CR//LF) /= 0) fileContent = CRLF2LF(fileContent) - if (fileContent(fileLength:fileLength) /= IO_EOL) fileContent = fileContent//IO_EOL ! ensure EOL@EOF + if (index(fileContent,CR//LF) /= 0) fileContent = CRLF2LF(fileContent) + if (fileContent(fileLength:fileLength) /= IO_EOL) fileContent = fileContent//IO_EOL ! ensure EOL@EOF end function IO_read