]> granicus.if.org Git - python/commitdiff
Caolan McNamara: properly undo the byte-stuffing of lines starting
authorGuido van Rossum <guido@python.org>
Tue, 9 May 2000 10:56:00 +0000 (10:56 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 9 May 2000 10:56:00 +0000 (10:56 +0000)
with a dot.  [GvR change: only unstuff when line starts with two dots.]

Lib/poplib.py

index 118811caafd1825f54e9b8b362ace7f76ce9e0a0..97a9b0dd62aca5ba99b49689f95ce7c94ec9e33d 100644 (file)
@@ -133,6 +133,9 @@ class POP3:
                list = []; octets = 0
                line, o = self._getline()
                while line != '.':
+                       if line[:2] == '..':
+                               o = o-1
+                               line = line[1:]
                        octets = octets + o
                        list.append(line)
                        line, o = self._getline()