about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-18 12:11:15 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-18 12:11:15 +0100
commitc0af45b47a78bc4d3f07d84b2e04d61e9ced75ac (patch)
tree2d27a40f9e7221465b3b4de2017f729772f3dac0
parentfc8937b53327f99b5809f78e3257e62a05bd1c79 (diff)
downloadchawan-c0af45b47a78bc4d3f07d84b2e04d61e9ced75ac.tar.gz
pager: remove useless code
-rw-r--r--src/local/client.nim2
-rw-r--r--src/local/pager.nim15
2 files changed, 1 insertions, 16 deletions
diff --git a/src/local/client.nim b/src/local/client.nim
index 60bdf411..b59e1ef4 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -892,7 +892,7 @@ proc newClient*(config: Config; forkserver: ForkServer; jsctx: JSContext):
   let loader = forkserver.newFileLoader(LoaderConfig(
     urimethodmap: config.getURIMethodMap(),
     w3mCGICompat: config.external.w3m_cgi_compat,
-    cgiDir: pager.cgiDir,
+    cgiDir: seq[string](config.external.cgi_dir),
     tmpdir: config.external.tmpdir
   ))
   pager.setLoader(loader)
diff --git a/src/local/pager.nim b/src/local/pager.nim
index e5d7d062..f5dbff4b 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -104,7 +104,6 @@ type
     askcursor: int
     askpromise*: Promise[bool]
     askprompt: string
-    cgiDir*: seq[string]
     commandMode {.jsget.}: bool
     config*: Config
     connectingContainers*: seq[ConnectingContainerItem]
@@ -277,13 +276,6 @@ proc quit*(pager: Pager, code = 0) =
   pager.term.quit()
   pager.dumpAlerts()
 
-proc setPaths(pager: Pager): Err[string] =
-  var cgiDir: seq[string]
-  for path in pager.config.external.cgi_dir:
-    cgiDir.add(path)
-  pager.cgiDir = cgiDir
-  return ok()
-
 proc newPager*(config: Config; forkserver: ForkServer; ctx: JSContext): Pager =
   let (mailcap, errs) = config.getMailcap()
   let pager = Pager(
@@ -295,13 +287,6 @@ proc newPager*(config: Config; forkserver: ForkServer; ctx: JSContext): Pager =
     term: newTerminal(stdout, config),
     urimethodmap: config.getURIMethodMap()
   )
-  let r = pager.setPaths()
-  if r.isErr:
-    pager.alert(r.error)
-    pager.alert("Exiting...")
-    #TODO maybe there is a better way to do this
-    pager.quit(1)
-    quit(1)
   for err in errs:
     pager.alert("Error reading mailcap: " & err)
   return pager