When decoding BASE64 text strings, must return two values.
authorChris Hanson <org/chris-hanson/cph>
Thu, 1 Jun 2000 19:29:05 +0000 (19:29 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 1 Jun 2000 19:29:05 +0000 (19:29 +0000)
v7/src/imail/mime-codec.scm

index d2dd123fce5686a8b4986485b0452eb9892f9dd8..4ef81b9e07acd1dbc71f85290b043ff2e235f898 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: mime-codec.scm,v 1.5 2000/06/01 18:25:37 cph Exp $
+;;; $Id: mime-codec.scm,v 1.6 2000/06/01 19:29:05 cph Exp $
 ;;;
 ;;; Copyright (c) 2000 Massachusetts Institute of Technology
 ;;;
                                pending-return?))
 
 (define (decode-base64-text-substring string start end pending-return?)
-  (decode-base64-internal string start end
-    (lambda (port)
-      (lambda (char)
-       (if pending-return?
-           (case char
-             ((#\linefeed)
-              (set! pending-return? #f)
-              (newline port))
-             ((#\return)
-              (write-char #\return port))
-             (else
-              (set! pending-return? #f)
-              (write-char #\return port)))
-           (if (char=? char #\return)
-               (set! pending-return? #t)
-               (write-char char port))))))
-  pending-return?)
+  (let ((result
+        (decode-base64-internal string start end
+          (lambda (port)
+            (lambda (char)
+              (if pending-return?
+                  (case char
+                    ((#\linefeed)
+                     (set! pending-return? #f)
+                     (newline port))
+                    ((#\return)
+                     (write-char #\return port))
+                    (else
+                     (set! pending-return? #f)
+                     (write-char #\return port)))
+                  (if (char=? char #\return)
+                      (set! pending-return? #t)
+                      (write-char char port))))))))
+    (values result pending-return?)))
 
 (define (decode-base64-internal string start end make-output)
   (let ((input (string->input-port string start end)))