[Jython-checkins] jython: Fix b2a_qp so that lines with a solitary period "." are encoded.

jim.baker jython-checkins at python.org
Sat May 10 17:38:04 CEST 2014


http://hg.python.org/jython/rev/a7b01f4cfb8d
changeset:   7238:a7b01f4cfb8d
user:        Indra Talip <indra.talip at gmail.com>
date:        Sat May 10 15:52:59 2014 +1000
summary:
  Fix b2a_qp so that lines with a solitary period "." are encoded.

files:
  src/org/python/modules/binascii.java |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/src/org/python/modules/binascii.java b/src/org/python/modules/binascii.java
--- a/src/org/python/modules/binascii.java
+++ b/src/org/python/modules/binascii.java
@@ -1081,6 +1081,11 @@
                     sb.append(lineEnd);
                     if (lineEnd.length() > 1) i++;
                 }
+                else if ((c == '.') && (count == 0) && endOfLine(s, lineEnd, i + 1)) {
+                    // RFC 1521 requires that a solitary "." alone on a line is encoded.
+                    count += 3;
+                    qpEscape(sb, c);
+                }
                 else if ((c == '\t' || c == ' ' ) && endOfLine(s, lineEnd, i + 1)) {
                     count += 3;
                     qpEscape(sb, c);

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list