aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-05-06 11:47:53 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-05-06 11:47:53 -0400
commit13a08c508005b9c3b280c05459e943a268b5ccc5 (patch)
tree246029b796ea10d7da11b7032970501bfa605589 /common
parentb9cac9bb26fe388abff34fa4fc562b0804cabb2e (diff)
downloadlevitating-13a08c508005b9c3b280c05459e943a268b5ccc5.tar.gz
levitating-13a08c508005b9c3b280c05459e943a268b5ccc5.zip
Fixed static file handler to allow subdirectories properly. Fixed directory file listing under Linux. Release listing now works through CGI.
Diffstat (limited to 'common')
-rw-r--r--common/utilities.F9011
1 files changed, 10 insertions, 1 deletions
diff --git a/common/utilities.F90 b/common/utilities.F90
index 670d48f..e8bceff 100644
--- a/common/utilities.F90
+++ b/common/utilities.F90
@@ -391,6 +391,7 @@ contains
end function get_directories_in_directory
function get_files_in_directory(directory) result(res)
+ use logging
implicit none
character(*), intent(in)::directory
@@ -398,6 +399,7 @@ contains
character(80)::line
character(len=:), pointer::tempfile
+ logical::skip_first
logical, dimension(:), allocatable::is_real_file
integer::unum, ierr, i, n, j
@@ -428,6 +430,8 @@ contains
i = i + 1
if(len_trim(line) > 0 .and. line(1:1) == '-' .and. line(1:6) /= "total ") then
is_real_file(i) = .TRUE.
+ else if(line(1:6) == "total ") then
+ skip_first = .TRUE.
end if
read(unum, '(A)', iostat=ierr) line
end do
@@ -448,7 +452,12 @@ contains
! Now we can read files
i = 0
- j = 0
+ if(skip_first) then
+ j = 1
+ else
+ j = 0
+ end if
+
read(unum, '(A)', iostat=ierr) line
do while(ierr == 0 .and. i < n)
j = j + 1