normalize_path Function

public pure function normalize_path(path) result(p)

Normalize a path to a consistent form for matching.

Transformations: - Backslashes (\) → slashes (/) - Strip any leading ./ prefixes (repeatedly)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: path

Return Value character(len=:), allocatable


Called by

proc~~normalize_path~~CalledByGraph proc~normalize_path normalize_path proc~compute_watch_files_from_settings compute_watch_files_from_settings proc~compute_watch_files_from_settings->proc~normalize_path proc~filter_watch_files filter_watch_files proc~compute_watch_files_from_settings->proc~filter_watch_files proc~gather_files_with_mask gather_files_with_mask proc~compute_watch_files_from_settings->proc~gather_files_with_mask proc~push_file_with_mask push_file_with_mask proc~compute_watch_files_from_settings->proc~push_file_with_mask proc~filter_watch_files->proc~normalize_path proc~is_ignored_path is_ignored_path proc~is_ignored_path->proc~normalize_path proc~is_in_dep_dirs is_in_dep_dirs proc~is_in_dep_dirs->proc~normalize_path proc~vec_push_unique vec_push_unique proc~vec_push_unique->proc~normalize_path proc~vec_push_unique->proc~is_ignored_path proc~vec_push_unique->proc~is_in_dep_dirs proc~gather_files_with_mask->proc~vec_push_unique proc~push_file_with_mask->proc~vec_push_unique 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 normalize_path(path) result(p)
      character(len=*), intent(in) :: path
      character(len=:), allocatable :: p
      integer :: i
      p = trim(path)
      do i = 1, len(p)
         if (p(i:i) == char(92)) p(i:i) = "/"
      end do
      do while (len(p) >= 2)
         if (p(1:2) == "./") then
            p = p(3:)
         else
            exit
         end if
      end do
   end function normalize_path