From beb210f16f2e351470f90b771ff95d9f18e95073 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 27 May 2020 16:20:20 -0400 Subject: Fixed handling of status code in renderers. Added a desired_url variable to maintain a current_url when a failure occurs. --- files.f90 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'files.f90') diff --git a/files.f90 b/files.f90 index b9f6d5a..9da1ae8 100644 --- a/files.f90 +++ b/files.f90 @@ -48,6 +48,21 @@ contains end function is_file_end_marker + subroutine skip_line(unit_number) + implicit none + + integer, intent(in)::unit_number + + character::c + integer::iostatus + + read(unit_number, '(A1)', advance='no', iostat=iostatus) c + do while(c /= CHAR(10) .AND. iostatus == 0) + read(unit_number, '(A1)', advance='no', iostat=iostatus) c + end do + + end subroutine skip_line + subroutine read_line_text(unit_number, res, iostatus) implicit none @@ -166,6 +181,10 @@ contains allocate(first_line) + ! Skip the first line - it has the status code + rewind(unit_number) + call skip_line(unit_number) + call read_line_text(unit_number, first_line%text, iostatus) first_line%next => null() -- cgit v1.2.3