rewrite POP3-DUMP to something legible
This commit is contained in:
sperber 2003-01-20 15:02:22 +00:00
parent 321bb04603
commit 3ef18b6abf
2 changed files with 11 additions and 10 deletions

View File

@ -261,14 +261,15 @@
(pop3-handle-response (pop3-read-response connection) command)))
(define (pop3-dump fd)
(let loop ((line (read-crlf-line fd)))
(cond ((and (not (eof-object? line))
(not (equal? line ".\r")))
(and (eq? 0 (string-index line #\.)) ; fix byte-stuffed lines
(eq? 1 (string-index line #\. 1))
(set! line (substring line 1 (string-length line))))
(write-string line)
(newline)
(loop (read-crlf-line fd))))))
(let loop ()
(let ((line (read-crlf-line fd)))
(if (and (not (eof-object? line))
(not (string=? line ".")))
(let ((line (if (string-prefix? ".." line)
(substring line 1 (string-length line))
line)))
(write-string line)
(newline)
(loop))))))
;; EOF

View File

@ -449,7 +449,7 @@
handle
conditions handle-fatal-error
signals
(subset srfi-13 (string-index))
(subset srfi-13 (string-index string-prefix?))
let-opt
crlf-io)
(files (lib pop3)))