]> code.delx.au - offlineimap/commitdiff
/offlineimap/head: changeset 444
authorjgoerzen <jgoerzen>
Fri, 18 Apr 2003 04:18:54 +0000 (05:18 +0100)
committerjgoerzen <jgoerzen>
Fri, 18 Apr 2003 04:18:54 +0000 (05:18 +0100)
Fixed line-ending code to deal with files with mixed \n and \r\n
codes. This is a rare case, but now is more onerous because we now
have to find headers.

offlineimap/head/debian/changelog
offlineimap/head/offlineimap/folder/IMAP.py

index 1981f0d6c338540d3c4fe3e24a433b002c745c61..34ab3d24708f7783ec3b0f44552e4c4cc72cc4ad 100644 (file)
@@ -1,3 +1,12 @@
+offlineimap (3.99.13) unstable; urgency=low
+
+  * Fixed password prompting for non-Curses UIs.
+  * Fixed line-ending code to deal with files with mixed \n and \r\n
+    codes.  This is a rare case, but now is more onerous because we now
+    have to find headers.
+
+ -- John Goerzen <jgoerzen@complete.org>  Thu, 17 Apr 2003 18:02:13 -0500
+
 offlineimap (3.99.12) unstable; urgency=low
 
   * This is a 4.0 TRACK release, and may be unstable or in flux!
index 6e043804470e0090a0736831658a62ac3a938cc0..34b4508c3538834dc786b7c82e5b6b4ea5488218 100644 (file)
@@ -174,8 +174,7 @@ class IMAPFolder(BaseFolder):
                 # but some IMAP servers nonetheless choke on 1902.
                 date = imaplib.Time2Internaldate(time.localtime())
 
-            if content.find("\r\n") == -1:  # Convert line endings if not already
-                content = content.replace("\n", "\r\n")
+            content = re.sub("[^\r]\n", "\r\n", content)
 
             (headername, headervalue) = self.savemessage_getnewheader(content)
             content = self.savemessage_addheader(content, headername,