diff --git a/WHATSNEW b/WHATSNEW index 5fdf91528b..e7af9c4299 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1,7 +1,11 @@ Changes from Ant 1.10.15 TO Ant 1.10.16 ======================================= +Fixed bugs: +----------- + * now properly handles IPv6 addresses as hostnames. + Bugzilla Report 59160 Changes from Ant 1.10.14 TO Ant 1.10.15 ======================================= diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java index 8719d39042..07c96896ba 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java @@ -435,8 +435,9 @@ private String parseUri(final String uri) { throw new BuildException("no username was given. Can't authenticate."); } - // For IPv6 address having more than one ":", it should look for the last occurrence - final int indexOfPath = uri.lastIndexof(':'); + // For IPv6 addresses, the host part may contain more than one ":", + // look for the last occurrence + final int indexOfPath = uri.lastIndexOf(':'); if (indexOfPath <= indexOfAt) { throw new BuildException("no remote path in %s", uri); }