aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2020-07-22 13:32:31 -0600
committerOndřej Čertík <ondrej@certik.us>2020-07-22 15:29:58 -0600
commit7c552525051b6fa2bb6699595baffd3b429e25b0 (patch)
tree8013c3a97d4e93cb3cee53c224cfb363ca5d5bd7
parentf517a92096820052186f314821206aadd7b648b3 (diff)
downloadfpm-7c552525051b6fa2bb6699595baffd3b429e25b0.tar.gz
fpm-7c552525051b6fa2bb6699595baffd3b429e25b0.zip
Implement str_ends_with()
-rw-r--r--fpm/src/fpm.f9012
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(:)