diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-07-22 13:32:31 -0600 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-07-22 15:29:58 -0600 |
commit | 7c552525051b6fa2bb6699595baffd3b429e25b0 (patch) | |
tree | 8013c3a97d4e93cb3cee53c224cfb363ca5d5bd7 | |
parent | f517a92096820052186f314821206aadd7b648b3 (diff) | |
download | fpm-7c552525051b6fa2bb6699595baffd3b429e25b0.tar.gz fpm-7c552525051b6fa2bb6699595baffd3b429e25b0.zip |
Implement str_ends_with()
-rw-r--r-- | fpm/src/fpm.f90 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90 index fc201e7..bffac56 100644 --- a/fpm/src/fpm.f90 +++ b/fpm/src/fpm.f90 @@ -129,6 +129,18 @@ character(len=*), intent(in) :: filename inquire(file=filename, exist=r) end function +logical function str_ends_with(s, e) result(r) +character(*), intent(in) :: s, e +integer :: n1, n2 +n1 = len(s)-len(e)+1 +n2 = len(s) +if (n1 < 1) then + r = .false. +else + r = (s(n1:n2) == e) +end if +end function + subroutine cmd_build() logical :: src type(string_t), allocatable :: files(:) |