git.fiddlerwoaroof.com
Browse code

too many returns

jkf authored on 10/08/2001 15:00:59
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+2001-08-10  John Foderaro  <jkf@tiger.franz.com>
2
+
3
+	* imap.cl - fix problems of too many #\returns in the header
4
+
1 5
 2001-06-26  John Foderaro  <jkf@tiger.franz.com>
2 6
 
3 7
 	*  imap.cl - fix typo in exported identifier
... ...
@@ -23,7 +23,7 @@
23 23
 ;; Suite 330, Boston, MA  02111-1307  USA
24 24
 ;;
25 25
 ;;
26
-;; $Id: smtp.cl,v 1.4 2001/05/11 16:40:30 jkf Exp $
26
+;; $Id: smtp.cl,v 1.5 2001/08/10 15:00:59 jkf Exp $
27 27
 
28 28
 ;; Description:
29 29
 ;;   send mail to an smtp server.  See rfc821 for the spec.
... ...
@@ -209,7 +209,8 @@
209 209
 	  
210 210
 	  
211 211
 	  
212
-	  (let ((at-bol t))
212
+	  (let ((at-bol t) 
213
+		(prev-ch nil))
213 214
 	    (dolist (message messages)
214 215
 	      (dotimes (i (length message))
215 216
 		(let ((ch (aref message i)))
... ...
@@ -218,9 +219,11 @@
218 219
 			  (write-char #\. sock))
219 220
 		  (if* (eq ch #\newline)
220 221
 		     then (setq at-bol t)
221
-			  (write-char #\return sock)
222
+			  (if* (not (eq prev-ch #\return))
223
+			     then (write-char #\return sock))
222 224
 		     else (setq at-bol nil))
223
-		  (write-char ch sock)))))
225
+		  (write-char ch sock)
226
+		  (setq prev-ch ch)))))
224 227
 	
225 228
 	  (write-char #\return sock) (write-char #\linefeed sock)
226 229
 	  (write-char #\. sock)