Skip to content

Commit

Permalink
read_lines uses the same static array idx
Browse files Browse the repository at this point in the history
  • Loading branch information
zoziha committed Sep 1, 2023
1 parent ea84821 commit 1feebe6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/fpm_filesystem.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ end function c_is_dir
#endif

integer, parameter :: max_line = 100000 !! maximum number of lines in a text file
integer :: idx(max_line) = 1 !! indexes for read_lines

contains

Expand Down Expand Up @@ -312,7 +313,6 @@ function read_lines_expanded(fh) result(lines)
integer :: i
integer :: length, count
character(len=:), allocatable :: content
integer, save :: idx(max_line) = 1

inquire (fh, size=length)
allocate (character(len=length) :: content)
Expand Down Expand Up @@ -343,7 +343,6 @@ function read_lines(fh) result(lines)
integer :: i
integer :: length, count
character(len=:), allocatable :: content
integer, save :: idx(max_line) = 1

inquire (fh, size=length)
allocate (character(len=length) :: content)
Expand Down

0 comments on commit 1feebe6

Please sign in to comment.