Skip to content

Commit 5fb00fd

Browse files
author
Rory Winston
committed
1 parent d559d41 commit 5fb00fd

File tree

1 file changed

+3
-2
lines changed
  • src/main/java/org/apache/commons/net/ftp

1 file changed

+3
-2
lines changed

src/main/java/org/apache/commons/net/ftp/FTP.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.apache.commons.net.SocketClient;
3434

3535
/***
36-
* FTP provides basic functionality necessary to implement your
36+
* FTP provides the basic the functionality necessary to implement your
3737
* own FTP client. It extends org.apache.commons.net.SocketClient since
3838
* extending TelnetClient was causing unwanted behavior (like connections
3939
* that did not time out properly).
@@ -311,7 +311,8 @@ private void __getReply() throws IOException
311311
// returning too soon after encountering a naked CR or some other
312312
// anomaly.
313313
}
314-
while ((line.length() >= 4 || line.charAt(3) == '-' || !(line.substring(0,3).matches("\\d{3}"))));
314+
while (!(line.length() >= 4 && line.charAt(3) != '-' &&
315+
Character.isDigit(line.charAt(0))));
315316
// This is too strong a condition because of non-conforming ftp
316317
// servers like ftp.funet.fi which sent 226 as the last line of a
317318
// 426 multi-line reply in response to ls /. We relax the condition to

0 commit comments

Comments
 (0)