aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurence Kedward <laurence.kedward@bristol.ac.uk>2021-07-17 19:56:26 +0100
committerGitHub <noreply@github.com>2021-07-17 19:56:26 +0100
commitbfa35568c2d3cc84fc3cdf14e8c8dfc881843fbe (patch)
treec7a22939a543dbd89f9e86a78589b6bcb15d6d40
parent68937a4eae6a71b74edbf762c574cc2dc22bb2d6 (diff)
parentf8b02175b403dd66d7f15db4bbf0de0765541b7f (diff)
downloadfpm-bfa35568c2d3cc84fc3cdf14e8c8dfc881843fbe.tar.gz
fpm-bfa35568c2d3cc84fc3cdf14e8c8dfc881843fbe.zip
Merge pull request #516 from urbanjost/unallocated
initialize allocatable strings before using in a comparison
-rw-r--r--src/fpm_sources.f9013
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fpm_sources.f90 b/src/fpm_sources.f90
index c781535..f349a0e 100644
--- a/src/fpm_sources.f90
+++ b/src/fpm_sources.f90
@@ -1,7 +1,7 @@
!># Discovery of sources
!>
-!> This module implements subroutines for building a list of
-!> `[[srcfile_t]]` objects by looking for source files in the filesystem.
+!> This module implements subroutines for building a list of
+!> `[[srcfile_t]]` objects by looking for source files in the filesystem.
!>
module fpm_sources
use fpm_error, only: error_t
@@ -158,7 +158,7 @@ subroutine add_executable_sources(sources,executables,scope,auto_discover,error)
if (basename(sources(j)%file_name,suffix=.true.) == executables(i)%main .and.&
canon_path(dirname(sources(j)%file_name)) == &
canon_path(executables(i)%source_dir) ) then
-
+
sources(j)%exe_name = executables(i)%name
if (allocated(executables(i)%link)) then
sources(j)%link_libraries = executables(i)%link
@@ -176,7 +176,7 @@ subroutine add_executable_sources(sources,executables,scope,auto_discover,error)
exe_source%link_libraries = executables(i)%link
end if
exe_source%unit_scope = scope
-
+
if (allocated(error)) return
if (.not.allocated(sources)) then
@@ -200,6 +200,11 @@ subroutine get_executable_source_dirs(exe_dirs,executables)
integer :: i, n
n = 0
+
+ do i=1,size(executables)
+ dirs_temp(i)%s=' '
+ enddo
+
do i=1,size(executables)
if (.not.(executables(i)%source_dir .in. dirs_temp)) then