diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-13 10:55:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 10:55:36 +0000 |
commit | d08e91f66e74040c602feb3ecb4cf461eeac27db (patch) | |
tree | ecc09612f51359cc7e3cd922a75660a6e6b13008 /src/fpm_filesystem.F90 | |
parent | c5ef60db6629987e06002ed02a2c1d4f37e58501 (diff) | |
parent | 76f87ebbf1e763426d6eae2e57dc27fb78767d03 (diff) | |
download | fpm-d08e91f66e74040c602feb3ecb4cf461eeac27db.tar.gz fpm-d08e91f66e74040c602feb3ecb4cf461eeac27db.zip |
Merge pull request #607 from urbanjost/list
Repair --list option and correct obsolete descriptions of the --list option
Diffstat (limited to 'src/fpm_filesystem.F90')
-rw-r--r-- | src/fpm_filesystem.F90 | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/fpm_filesystem.F90 b/src/fpm_filesystem.F90 index 102d6c5..83cffe7 100644 --- a/src/fpm_filesystem.F90 +++ b/src/fpm_filesystem.F90 @@ -94,21 +94,18 @@ function basename(path,suffix) result (base) with_suffix = suffix end if - if (with_suffix) then - call split(path,file_parts,delimiters='\/') - if(size(file_parts).gt.0)then - base = trim(file_parts(size(file_parts))) - else - base = '' - endif + call split(path,file_parts,delimiters='\/') + if(size(file_parts).gt.0)then + base = trim(file_parts(size(file_parts))) else - call split(path,file_parts,delimiters='\/.') + base = '' + endif + if(.not.with_suffix)then + call split(base,file_parts,delimiters='.') if(size(file_parts).ge.2)then base = trim(file_parts(size(file_parts)-1)) - else - base = '' endif - end if + endif end function basename |