Fix bugs in IMAP mailbox encode/decode procedures.
authorChris Hanson <org/chris-hanson/cph>
Wed, 5 Jul 2000 01:04:01 +0000 (01:04 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 5 Jul 2000 01:04:01 +0000 (01:04 +0000)
v7/src/imail/imap-syntax.scm

index f53de2997dcf4e46c551207ed451a4da163543a5..b4f083714e32c70fac30501e8cf5c49611c930d0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imap-syntax.scm,v 1.12 2000/07/05 00:20:36 cph Exp $
+;;; $Id: imap-syntax.scm,v 1.13 2000/07/05 01:04:01 cph Exp $
 ;;;
 ;;; Copyright (c) 2000 Massachusetts Institute of Technology
 ;;;
                             j
                             (encode-mailbox-name-1 string index index* s j))))
                    (string-set! s j #\-)
-                   (loop index* (fix:+ j 1))))))))
+                   (loop index* (fix:+ j 1)))))
+             (substring-move! string start end s j))))
       s)))
 \f
 (define (imap:decode-mailbox-name string #!optional start end)
                       (substring-find-next-char string (fix:+ index 1) end
                                                 #\-)))
                  (if (not index*) (lose))
-                 (let ((j (substring-move! string start end s j))
+                 (let ((j (substring-move! string start index s j))
                        (m (fix:- index* index)))
                    (if (fix:= m 1)
                        (begin
                                                     index*
                                                     s
                                                     j
-                                                    lose))))))))
+                                                    lose)))))
+               (substring-move! string start end s j))))
        s))))
 \f
 (define (encode-mailbox-name-1 string start end s j)