diff options
-rw-r--r-- | main.F90 | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -154,6 +154,8 @@ implicit none if(.not. loaded) then + call check_slashless_url(desired_url) + call r%clear_favicon() call r%report_status("Requesting "//trim(desired_url)) @@ -385,5 +387,28 @@ contains end if end subroutine save_favorites + + ! Checks to see if the url is just a server name with no + ! trailing slash, and fixes it + subroutine check_slashless_url(url) + implicit none + + character(*), intent(inout)::url + integer::i, slash_count + + slash_count = 0 + if(index(url, "://") /= 0) then + do i = 1, len_trim(url) + if(url(i:i) == '/') then + slash_count = slash_count + 1 + end if + end do + + if(slash_count == 2) then + url(i:i) = "/" + end if + end if + + end subroutine check_slashless_url end program gemini |