Fix to encoding of space in gnu.mail.util.QPOutputStream

Øyvind Harboe <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.javamail
Organization Zylin AS
Message-ID <1075384715.3180.10.camel@famine>
Space was being output twice.

This seems to fix the problem.


Index: QPOutputStream.java
===================================================================
retrieving revision 1.3
diff -u -r1.3 QPOutputStream.java
--- QPOutputStream.java	19 Mar 2003 18:28:38 -0000	1.3
+++ QPOutputStream.java	29 Jan 2004 13:55:56 -0000
@@ -111,7 +111,11 @@
    */
   public void flush() throws IOException 
   {
-    out.flush();
+  	if (gotSpace)
+  	{
+		output(' ', false);
+  	}
+  	out.flush();
   } // flush()
 
   /**
@@ -175,11 +179,13 @@
         gotCR = false;
       else
         outputCRLF();
+    } else
+    {
+		if (b<' ' || b>=127 || b=='=')
+		  output(b, true);
+		else
+		  output(b, false);
     }
-    if (b<' ' || b>=127 || b=='=')
-      output(b, true);
-    else
-      output(b, false);
   } // write()
 
   /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.