Skip to content

Commit e0a6363

Browse files
authored
BUG-ID : 59160 , fix extracting host for ipv6 address
1 parent 146baef commit e0a6363

File tree

1 file changed

+2
-1
lines changed
  • src/main/org/apache/tools/ant/taskdefs/optional/ssh

1 file changed

+2
-1
lines changed

src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ private String parseUri(final String uri) {
435435
throw new BuildException("no username was given. Can't authenticate.");
436436
}
437437

438-
final int indexOfPath = uri.indexOf(':', indexOfAt + 1);
438+
// For IPv6 address having more than one ":", it should look for the last occurrence
439+
final int indexOfPath = uri.lastIndexof(':');
439440
if (indexOfPath == -1) {
440441
throw new BuildException("no remote path in %s", uri);
441442
}

0 commit comments

Comments
 (0)