summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorPaul A. Patience <paul@apatience.com>2021-07-10 12:12:46 -0400
committerKaz Kylheku <kaz@kylheku.com>2021-07-10 17:46:20 -0700
commit5a75bbff7852752ffb09afc57b171dfcf4dbd51a (patch)
tree53c20f67c3ba9a0c4b6c645f7bd98a923440bee4 /stdlib
parente11ce7002975eb2ad785f4bd9ca3f0c95a86a9aa (diff)
downloadtxr-5a75bbff7852752ffb09afc57b171dfcf4dbd51a.tar.gz
txr-5a75bbff7852752ffb09afc57b171dfcf4dbd51a.tar.bz2
txr-5a75bbff7852752ffb09afc57b171dfcf4dbd51a.zip
doc-lookup: ignore BROWSER when empty.
* stdlib/doc-lookup.tl (open-url): Treat empty BROWSER variable as if it were unset (i.e., ignore it). Otherwise the doc function silently fails rather than falling back to alternative URL-opening methods. * txr.1: Documented.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/doc-lookup.tl16
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/doc-lookup.tl b/stdlib/doc-lookup.tl
index e939aa2a..231d3b62 100644
--- a/stdlib/doc-lookup.tl
+++ b/stdlib/doc-lookup.tl
@@ -36,14 +36,14 @@
(fallback '#"firefox iceweasel seamonkey mozilla \
epiphany konqueror chromium chromium-browser \
google-chrome"))
- (let ((prog (or (getenv "BROWSER")
- (if (abs-path-p opener)
- opener
- (path-search opener))
- [find-true path-search fallback])))
- (if prog
- (detached-run prog (list url))
- (error "~s: no URL-opening method available" 'open-url))))))
+ (iflet ((prog (getenv "BROWSER"))
+ (prog (or (and (plusp (len prog)) prog)
+ (if (abs-path-p opener)
+ opener
+ (path-search opener))
+ [find-true path-search fallback])))
+ (detached-run prog (list url))
+ (error "~s: no URL-opening method available" 'open-url)))))
((:cygwin :cygnal)
(with-dyn-lib "shell32.dll"
(deffi shell-execute "ShellExecuteW"