commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1601150 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/telnet/Telnet.java
Date Sat, 07 Jun 2014 16:19:21 GMT
Author: sebb
Date: Sat Jun  7 16:19:20 2014
New Revision: 1601150

URL: http://svn.apache.org/r1601150
Log:
NET-543 telnet: spy read EOL is reversed

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1601150&r1=1601149&r2=1601150&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Sat Jun  7 16:19:20 2014
@@ -68,6 +68,9 @@ This is mainly a bug-fix release. See fu
   IMAPExportMbox (example app) allows IMAP folders to be exported into an mbox file.
   This is the inverse of the IMAPImportMbox example added previously
         ">
+            <action issue="NET-543" type="fix" dev="sebb" due-to="Ferry Huberts">
+            telnet: spy read EOL is reversed
+            </action>
             <action issue="NET-540" type="add" dev="sebb">
             Article#printThread should have option to use any PrintStream
             </action>

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java?rev=1601150&r1=1601149&r2=1601150&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java Sat Jun
 7 16:19:20 2014
@@ -1203,13 +1203,13 @@ class Telnet extends SocketClient
         {
             try
             {
-                if (ch != '\r')
+                if (ch != '\r') // never write '\r' on its own
                 {
-                    spy.write(ch);
                     if (ch == '\n')
                     {
-                        spy.write('\r');
+                        spy.write('\r'); // add '\r' before '\n'
                     }
+                    spy.write(ch); // write original character
                     spy.flush();
                 }
             }



Mime
View raw message