Fix bug: server continuation lines not being parsed correctly.
authorChris Hanson <org/chris-hanson/cph>
Mon, 22 May 2000 15:24:50 +0000 (15:24 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 22 May 2000 15:24:50 +0000 (15:24 +0000)
v7/src/imail/imap-response.scm

index e9c927bdf1cec5eaec766db531ec4666fb5a98d2..bd66d0f699c5f636e3135ce0c27ae549f66a6bd4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imap-response.scm,v 1.23 2000/05/21 00:03:05 cph Exp $
+;;; $Id: imap-response.scm,v 1.24 2000/05/22 15:24:50 cph Exp $
 ;;;
 ;;; Copyright (c) 2000 Massachusetts Institute of Technology
 ;;;
   (let ((tag (read-string-internal char-set:space port)))
     (if (eof-object? tag)
        tag
-       (begin
-         (discard-known-char #\space port)
-         (let ((response
-                (cond ((string=? "+" tag)
-                       (cons 'CONTINUE (read-response-text port)))
-                      ((string=? "*" tag)
-                       (read-untagged-response port))
-                      ((let ((end (string-length tag)))
-                         (let ((index (imap:match:tag tag 0 end)))
-                           (and index
-                                (fix:= index end))))
-                       (read-tagged-response tag port))
-                      (else
-                       (error "Malformed server response:" tag)))))
-           (discard-known-char #\return port)
-           (discard-known-char #\linefeed port)
-           response)))))
+       (let ((response
+              (if (string=? "+" tag)
+                  (cons 'CONTINUE (read-response-text port))
+                  (begin
+                    (discard-known-char #\space port)
+                    (cond ((string=? "*" tag)
+                           (read-untagged-response port))
+                          ((let ((end (string-length tag)))
+                             (let ((index (imap:match:tag tag 0 end)))
+                               (and index
+                                    (fix:= index end))))
+                           (read-tagged-response tag port))
+                          (else
+                           (error "Malformed server response:" tag)))))))
+         (discard-known-char #\return port)
+         (discard-known-char #\linefeed port)
+         response))))
 
 (define (read-untagged-response port)
   (let ((x (read-atom port)))