aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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