geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r658248 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/org/apache/geronimo/mail/util/QuotedPrintableEncoder.java
Date Tue, 20 May 2008 13:59:15 GMT
Author: rickmcguire
Date: Tue May 20 06:59:15 2008
New Revision: 658248

URL: http://svn.apache.org/viewvc?rev=658248&view=rev
Log:
GERONIMO-4033 QuotedPrintableEncoder.decode(InputStream) doesn't handle space before soft
newline

patch provided by aaron pieper


Modified:
    geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/org/apache/geronimo/mail/util/QuotedPrintableEncoder.java

Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/org/apache/geronimo/mail/util/QuotedPrintableEncoder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/org/apache/geronimo/mail/util/QuotedPrintableEncoder.java?rev=658248&r1=658247&r2=658248&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/org/apache/geronimo/mail/util/QuotedPrintableEncoder.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/org/apache/geronimo/mail/util/QuotedPrintableEncoder.java
Tue May 20 06:59:15 2008
@@ -576,14 +576,16 @@
                 // return the real significant character now.
                 return ch;
             }
-            else {
-            // remember this character for later, after we've used up the deferred blanks.
-                cachedCharacter = ch;
-                // return this space.  We did not include this one in the deferred count,
so we're right in sync.
-                return ' ';
-            }
+                       // remember this character for later, after we've used up the deferred
blanks.
+            cachedCharacter = decodeNonspaceChar(in, ch);
+            // return this space.  We did not include this one in the deferred count, so
we're right in sync.
+            return ' ';
         }
-        else if (ch == '=') {
+        return decodeNonspaceChar(in, ch);
+    }
+
+       private int decodeNonspaceChar(InputStream in, int ch) throws IOException {
+               if (ch == '=') {
             int b1 = in.read();
             // we need to get two characters after the quotation marker
             if (b1 == -1) {



Mime
View raw message