aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2021-05-13 10:54:27 -0400
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2021-05-13 10:54:27 -0400
commit6c8e6ba0c13b06f28c327da0c507c0a74ba226ed (patch)
treefe425c7210abcfc4860bb49bcd1ff9736e667875
parent5b7edc814fa39ae1a1ff031fabbf95e1d01c5265 (diff)
downloadLR-87-6c8e6ba0c13b06f28c327da0c507c0a74ba226ed.zip
LR-87-6c8e6ba0c13b06f28c327da0c507c0a74ba226ed.tar.gz
URLs that are just server names will now get an added slash.HEADmaster
-rw-r--r--main.F9025
1 files changed, 25 insertions, 0 deletions
diff --git a/main.F90 b/main.F90
index 0738bb0..7903ca7 100644
--- a/main.F90
+++ b/main.F90
@@ -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