trim_or_empty Function

public pure function trim_or_empty(s) result(r)

Trim an allocatable string or return an empty string if unallocated.

Arguments

Type IntentOptional Attributes Name
character(len=:), intent(in), allocatable :: s

Return Value character(len=:), allocatable


Called by

proc~~trim_or_empty~~CalledByGraph proc~trim_or_empty trim_or_empty proc~compute_watch_files_from_settings compute_watch_files_from_settings proc~compute_watch_files_from_settings->proc~trim_or_empty proc~rebuild_watch_list rebuild_watch_list proc~rebuild_watch_list->proc~compute_watch_files_from_settings proc~handle_manifest_change handle_manifest_change proc~handle_manifest_change->proc~rebuild_watch_list proc~watcher_init watcher_t%watcher_init proc~watcher_init->proc~rebuild_watch_list proc~watcher_run watcher_t%watcher_run proc~watcher_run->proc~rebuild_watch_list proc~watcher_run->proc~handle_manifest_change

Source Code

   pure function trim_or_empty(s) result(r)
      character(len=:), allocatable, intent(in) :: s
      character(len=:), allocatable :: r
      if (allocated(s)) then
         r = trim(s)
      else
         r = ""
      end if
   end function trim_or_empty