ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49173] New: Telnet task is broken on read
Date Fri, 23 Apr 2010 01:32:53 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49173

           Summary: Telnet task is broken on read
           Product: Ant
           Version: 1.8.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: jameswartell@gmail.com


re: org.apache.tools.ant.taskdefs.optional.net.TelnetTask

The two instances of while-loops currently written like this

while (windowStart++ < 0 
    || !sb.substring(windowStart).equals(s)) {

are wrong. The increment happens before taking the substring. Changing it to
this

while (windowStart < 0 
    || !sb.substring(windowStart).equals(s)) {
    windowStart++;

makes it clearer when windowStart is incremented, and makes the code correct. 

Debugging the code while doing the classic case, looking for "ogin:" before
typing the username demonstrates that the comparison will be "ogin:" to "gin:"
at the iteration when it should break out of the loop, making the loop
invariant true.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message