correct check for CRLF

old attempt tried to look only at forst occurence of LF but reported
CRLF also for LF endings.
This commit is contained in:
Martin Diehl 2023-02-09 23:32:39 +01:00
parent 4e57df9576
commit a2bde4a0f0
1 changed files with 2 additions and 2 deletions

View File

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