aboutsummaryrefslogtreecommitdiff
path: root/main.F90
diff options
context:
space:
mode:
Diffstat (limited to 'main.F90')
-rw-r--r--main.F9035
1 files changed, 18 insertions, 17 deletions
diff --git a/main.F90 b/main.F90
index 9055664..02eab98 100644
--- a/main.F90
+++ b/main.F90
@@ -45,7 +45,7 @@ use wsa_network, only: windows_network_startup => startup
implicit none
character(256)::initial_site
- character(1024)::current_url, input
+ character(1024)::current_url, desired_url, input
type(connection)::conn
#ifdef WINDOWS_GUI
@@ -101,15 +101,16 @@ implicit none
call r%initialize()
locations_visited => null()
- current_url = initial_site
+ desired_url = initial_site
+ current_url = " "
first_line => null()
open(unit=io, form="formatted", status="scratch", access='stream')
do while(running)
- if(index(current_url, "gemini://") /= 1) then
- redo_layout = r%report_unsupported_protocol(trim(current_url))
+ if(index(desired_url, "gemini://") /= 1) then
+ redo_layout = r%report_unsupported_protocol(trim(desired_url))
populated = .false.
loaded = .true.
return_code = STATUS_LOCALFAIL
@@ -117,24 +118,24 @@ implicit none
if(.not. loaded) then
- call r%report_status("Requesting "//trim(current_url))
+ call r%report_status("Requesting "//trim(desired_url))
- return_code = request_url(current_url, io, return_type, bh)
+ return_code = request_url(desired_url, io, return_type, bh)
populated = .true.
- call update_status(r, current_url, return_code)
+ call update_status(r, desired_url, return_code)
end if
if(return_code == STATUS_REDIRECT) then
- call get_redirect_url(io, current_url)
+ call get_redirect_url(io, desired_url)
loaded = .false.
populated = .false.
else if(return_code == STATUS_INPUT) then
- if(handle_input(r, current_url, io)) then
+ if(handle_input(r, desired_url, io)) then
! Should force a new load
loaded = .false.
else
@@ -143,6 +144,9 @@ implicit none
else if(populated) then
+ current_url = desired_url
+ desired_url = " "
+
locations_visited => add_location(locations_visited, current_url)
if(r%type_supported(return_type)) then
@@ -162,7 +166,7 @@ implicit none
else
call r%draw_error("Cannot display file of type "//return_type)
- call back_location(locations_visited, current_url)
+ call back_location(locations_visited, desired_url)
end if
@@ -185,7 +189,7 @@ implicit none
running = .false.
case (render_action_back)
- call back_location(locations_visited, current_url)
+ call back_location(locations_visited, desired_url)
loaded = .false.
case (render_action_layout)
@@ -196,16 +200,13 @@ implicit none
end if
case (render_action_goto)
-
if(index(input, "://") > 0) then
- current_url = input
+ desired_url = input
else
- call handle_relative_url(current_url, input)
+ desired_url = current_url
+ call handle_relative_url(desired_url, input)
end if
- !if(associated(first_line)) then
- ! call free_lines(first_line)
- !end if
loaded = .false.
end select