From 9bd9d3ff3b87fa28c7c731a977a934c88cb55503 Mon Sep 17 00:00:00 2001 From: LKedward Date: Mon, 7 Sep 2020 15:47:29 +0100 Subject: Fix: more trimming of split string output. --- fpm/src/fpm_sources.f90 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fpm/src/fpm_sources.f90 b/fpm/src/fpm_sources.f90 index fb6e57a..67d6fc5 100644 --- a/fpm/src/fpm_sources.f90 +++ b/fpm/src/fpm_sources.f90 @@ -236,7 +236,7 @@ function parse_f_source(f_filename) result(f_source) if (index(file_lines(i)%s,'::') > 0) then call split(file_lines(i)%s,line_parts,delimiters=':') - temp_string = line_parts(2) + temp_string = trim(line_parts(2)) call split(temp_string,line_parts,delimiters=' ,') mod_name = trim(lower(line_parts(1))) @@ -273,7 +273,7 @@ function parse_f_source(f_filename) result(f_source) if (pass == 2) then call split(file_lines(i)%s,line_parts,delimiters="'"//'"') - f_source%include_dependencies(n_include)%s = line_parts(2) + f_source%include_dependencies(n_include)%s = trim(line_parts(2)) end if end if @@ -322,12 +322,10 @@ function parse_f_source(f_filename) result(f_source) end if - ! Extract name of program if is program + ! Detect if is program if (f_source%unit_type == FPM_UNIT_UNKNOWN .and. & index(adjustl(lower(file_lines(i)%s)),'program') == 1) then - call split(file_lines(i)%s,line_parts,delimiters=' ') - f_source%unit_type = FPM_UNIT_PROGRAM end if @@ -433,7 +431,7 @@ function parse_c_source(c_filename) result(c_source) if (pass == 2) then call split(file_lines(i)%s,line_parts,delimiters='"') - c_source%include_dependencies(n_include)%s = line_parts(2) + c_source%include_dependencies(n_include)%s = trim(line_parts(2)) end if end if -- cgit v1.2.3