Skip to content

Commit

Permalink
BUG-ID : 59160 , fix extracting host for ipv6 address
Browse files Browse the repository at this point in the history
  • Loading branch information
FROZENCADET authored Oct 3, 2024
1 parent 146baef commit e0a6363
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ private String parseUri(final String uri) {
throw new BuildException("no username was given. Can't authenticate.");
}

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

0 comments on commit e0a6363

Please sign in to comment.