diff options
author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2021-05-13 10:54:27 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2021-05-13 10:54:27 -0400 |
commit | 6c8e6ba0c13b06f28c327da0c507c0a74ba226ed (patch) | |
tree | fe425c7210abcfc4860bb49bcd1ff9736e667875 | |
parent | 5b7edc814fa39ae1a1ff031fabbf95e1d01c5265 (diff) | |
download | LR-87-6c8e6ba0c13b06f28c327da0c507c0a74ba226ed.tar.gz LR-87-6c8e6ba0c13b06f28c327da0c507c0a74ba226ed.zip |
URLs that are just server names will now get an added slash.
-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 |