aboutsummaryrefslogtreecommitdiff
path: root/main.F90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-05 11:56:54 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-05 11:56:54 -0400
commitb063cac571202757ec25f2c6e2a772684b88d4ae (patch)
treebcdd9426a90d8e9bec4498bffd2f97686ba28d41 /main.F90
parent0ade9914918238b8da35e995fe9782a517988ae2 (diff)
downloadLR-87-b063cac571202757ec25f2c6e2a772684b88d4ae.zip
LR-87-b063cac571202757ec25f2c6e2a772684b88d4ae.tar.gz
Added input handling with escaping, all untested.
Diffstat (limited to 'main.F90')
-rw-r--r--main.F9021
1 files changed, 20 insertions, 1 deletions
diff --git a/main.F90 b/main.F90
index 9ab1782..a457d01 100644
--- a/main.F90
+++ b/main.F90
@@ -18,6 +18,7 @@ implicit none
logical::running
logical::loaded
+ logical::populated
integer::return_code
@@ -62,11 +63,19 @@ implicit none
do while(running)
+ if(index(current_url, "gemini://") /= 1) then
+ call r%draw_error("Only gemini:// URLs are supported")
+ populated = .false.
+ loaded = .true.
+ return_code = STATUS_LOCALFAIL
+ end if
+
if(.not. loaded) then
call r%report_status("Requesting "//trim(current_url))
return_code = request_url(trim(current_url), io)
+ populated = .true.
call update_status(r, current_url, return_code)
@@ -76,8 +85,18 @@ implicit none
call get_redirect_url(io, current_url)
loaded = .false.
+ populated = .false.
- else
+ else if(return_code == STATUS_INPUT) then
+
+ if(handle_input(r, current_url, io)) then
+ ! Should force a new load
+ loaded = .false.
+ else
+ loaded = .true.
+ end if
+
+ else if(populated) then
first_line => load_unit(io, file_type_gemini)
loaded = .true.