Normalize a path to a consistent form for matching.
Transformations:
- Backslashes (\) → slashes (/)
- Strip any leading ./ prefixes (repeatedly)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
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