Further simplify reading by calling read-lines instead - holymoly - A tor enabled gopher client written in CHICKEN scheme
(HTM) git clone git://vernunftzentrum.de/holymoly.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 24141c4a83cd1cd82a13526dc47bb54bde811d93
(DIR) parent 144b5565d9b5dcc88bb2a209546d363f5efe64b6
(HTM) Author: Christian Kellermann <ckeen@pestilenz.org>
Date: Wed, 25 Apr 2018 15:56:36 +0200
Further simplify reading by calling read-lines instead
Diffstat:
holymoly.scm | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/holymoly.scm b/holymoly.scm
@@ -160,9 +160,7 @@
(display (string-append resource (string #\linefeed #\return)) o)
(let ((response (if until-eof?
(read-u8vector #f i)
- (let* ((raw (read-all i))
- (l (string-split raw "\r\n")))
- (butlast l)))))
+ (butlast (read-lines i)))))
(close-input-port i)
(close-output-port o)
response))
@@ -276,7 +274,7 @@
(old-selector (entry-selector e)))
(if (null? query)
(select-entry (current-page))
- (entry-selector-set! e (string-append (car (string-split old-selector "?")) "?" (string-intersperse (string-split query) "+"))))))
+ (entry-selector-set! e (string-append (car (string-split old-selector "?")) "?" (string-intersperse (string-split query) "+"))))))
(unless (equal? e (current-page))
(push! e history))
(let* ((res (request-resource (entry-host e) (entry-selector e) (entry-port e) (memq (entry-type e) '(dos-archive binary gif))))
@@ -289,8 +287,8 @@
(new-status "~a" next)
(cond
((equal? next 'quit) (exit 0))
- ((equal? next 'back) (select-entry (previous-page)))
- (else (select-entry next)))))
+ ((equal? next 'back) (select-entry (previous-page)))
+ (else (select-entry next)))))
(define (uri->entry uri-string)
(let* ((u (uri-reference uri-string))